cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
GDL
About building parametric objects with GDL.
SOLVED!

Mirror angle hotspot

Jeroen
Graphisoft Partner
Graphisoft Partner

When I mirror the Editable Angle Hotspot something goes wrong. How can I mirror this (without creating a new hotspot for mirrored cases, because the hotspot is in a macro)

Normal:

Jeroen_0-1689237788827.png

Mirrored

Jeroen_1-1689237810973.png

Code:

Jeroen_2-1689237876237.png

FOR i = 1 TO 2
	IF i = 2 THEN
		ADD2 0,-DikteDraaideel
		MUL2 1,-1
	ELSE !i=1

	ENDIF

	HOTSPOT2 0, 0, 1, ohtd, 6
	HOTSPOT2 A, 0, 2, ohtd, 4
	HOTSPOT2 A*COS(ohtd), A*SIN(ohtd), 3,ohtd, 5

	LINE2 0,0,A*COS(ohtd), A*SIN(ohtd)
	HOTLINE2 0,0,A*COS(ohtd), A*SIN(ohtd)
	ARC2 0,0,A,0,ohtd
	HOTARC2 0,0,A,0,ohtd

NEXT i	


thanks a lot,
Jeroen de Bruin

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Barry Kelly
Moderator

The mirrored hotspot needs it angle of rotation reversed with a 512 attribute value.

 

Change the rotating hotspot (6) to this ... HOTSPOT2 0, 0, 1, ohtd, 6+512*(i-1)

 

When i = 1 it will not reverse (512*0).

When i = 2 it will reverse (512*1).

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

View solution in original post

2 REPLIES 2
Solution
Barry Kelly
Moderator

The mirrored hotspot needs it angle of rotation reversed with a 512 attribute value.

 

Change the rotating hotspot (6) to this ... HOTSPOT2 0, 0, 1, ohtd, 6+512*(i-1)

 

When i = 1 it will not reverse (512*0).

When i = 2 it will reverse (512*1).

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Jeroen
Graphisoft Partner
Graphisoft Partner

I am glad it was this easy, though I still had to transfer another parameter to the macro. Thanks Barry