BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Rotating Dynamic Hotspot Help?

JGoode
Advocate
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 23

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-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5
JGoode
Advocate
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 23

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
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
JGoode
Advocate
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 23

Windows 10
Learn and get certified!