cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
JGoode
Expert

Rotating Dynamic Hotspot Help?

Hi,
I have tried using the script given in the gdl guide but I can't seem to get it to work. Does anyone know how to make it work correctly?
! --------------------------------------------------------------------------------
! Center
! --------------------------------------------------------------------------------
hotspot2 0, 0, unID, ang, 6     : unID = unID + 1

! --------------------------------------------------------------------------------
! Base
! --------------------------------------------------------------------------------
hotspot2 r, 0, unID, ang, 4     : unID = unID + 1

! --------------------------------------------------------------------------------
! Moving
! --------------------------------------------------------------------------------
hotspot2 r * COS(ang), r * SIN(ang), unID, ang, 5     : unID = unID + 1
I have created parameters for ang and R.

I really just need some explanation of the code. For some reason the angle increases when going anti-clockwise instead of clockwise. In 2D. The base does isn't position above at what should be 0 degrees.
ArchiCAD 27

Windows 10
4 Replies 4
Erwin Edel
Rockstar
If I look at page 197 of the GDL Reference Guide in ArchiCAD 20, the diagram is quite clearly going counter clockwise, perhaps this is intended?

Edit: this is also how the angles work in ArchiCAD when drafting.
Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-29NED FULL
Windows 11 Pro for Workstations
Adobe Design Premium CS5
JGoode
Expert
Erwin wrote:
If I look at page 197 of the GDL Reference Guide in ArchiCAD 20, the diagram is quite clearly going counter clockwise, perhaps this is intended?

Edit: this is also how the angles work in ArchiCAD when drafting.
Seems very strange. I was having some other issues when changing the centre point of the rotation so I have had to keep it at 0, 0 which is inconvenient. Thanks for the help.
ArchiCAD 27

Windows 10
Barry Kelly
Moderator
JGoode wrote:
Seems very strange. I was having some other issues when changing the centre point of the rotation so I have had to keep it at 0, 0 which is inconvenient. Thanks for the help.
All of the hotspots need to have the same base co-ordinates.
An easy way to do this is leave the base at 0,0 but put an ADD before the hotspots
i.e.
ADD x, y
! Center 
! -------------------------------------------------------------------------------- 
hotspot2 0, 0, unID, ang, 6     : unID = unID + 1 

! -------------------------------------------------------------------------------- 
! Base 
! -------------------------------------------------------------------------------- 
hotspot2 r, 0, unID, ang, 4     : unID = unID + 1 

! -------------------------------------------------------------------------------- 
! Moving 
! -------------------------------------------------------------------------------- 
hotspot2 r * COS(ang), r * SIN(ang), unID, ang, 5     : unID = unID + 1

DEL 1
or
 ! Center 
! -------------------------------------------------------------------------------- 
hotspot2 x+0, y+0, unID, ang, 6     : unID = unID + 1 

! -------------------------------------------------------------------------------- 
! Base 
! -------------------------------------------------------------------------------- 
hotspot2 x+r, y+0, unID, ang, 4     : unID = unID + 1 

! -------------------------------------------------------------------------------- 
! Moving 
! -------------------------------------------------------------------------------- 
hotspot2 x+r * COS(ang), y+r * SIN(ang), unID, ang, 5     : unID = unID + 1
Adding a flag value of 512 to the centre hotspot (type 6) will make it rotate in the opposite direction.

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
JGoode
Expert
Barry wrote:
JGoode wrote:
Seems very strange. I was having some other issues when changing the centre point of the rotation so I have had to keep it at 0, 0 which is inconvenient. Thanks for the help.
All of the hotspots need to have the same base co-ordinates.
An easy way to do this is leave the base at 0,0 but put an ADD before the hotspots
i.e.
ADD x, y
! Center 
! -------------------------------------------------------------------------------- 
hotspot2 0, 0, unID, ang, 6     : unID = unID + 1 

! -------------------------------------------------------------------------------- 
! Base 
! -------------------------------------------------------------------------------- 
hotspot2 r, 0, unID, ang, 4     : unID = unID + 1 

! -------------------------------------------------------------------------------- 
! Moving 
! -------------------------------------------------------------------------------- 
hotspot2 r * COS(ang), r * SIN(ang), unID, ang, 5     : unID = unID + 1

DEL 1
or
 ! Center 
! -------------------------------------------------------------------------------- 
hotspot2 x+0, y+0, unID, ang, 6     : unID = unID + 1 

! -------------------------------------------------------------------------------- 
! Base 
! -------------------------------------------------------------------------------- 
hotspot2 x+r, y+0, unID, ang, 4     : unID = unID + 1 

! -------------------------------------------------------------------------------- 
! Moving 
! -------------------------------------------------------------------------------- 
hotspot2 x+r * COS(ang), y+r * SIN(ang), unID, ang, 5     : unID = unID + 1
Adding a flag value of 512 to the centre hotspot (type 6) will make it rotate in the opposite direction.

Barry.
Thanks very much. This is very useful.
ArchiCAD 27

Windows 10

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!