Rotating Dynamic Hotspot Help?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-09-04 11:10 AM
‎2017-09-04
11:10 AM
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 + 1I 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
Windows 10
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-09-04 01:01 PM
‎2017-09-04
01:01 PM
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.
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
www.leloup.nl
ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-09-04 01:28 PM
‎2017-09-04
01:28 PM
Erwin 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.
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.
ArchiCAD 23
Windows 10
Windows 10

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-09-05 02:44 AM
‎2017-09-05
02:44 AM
JGoode wrote:All of the hotspots need to have the same base co-ordinates.
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.
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 1or
! 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 + 1Adding 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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-09-05 10:07 AM
‎2017-09-05
10:07 AM
Barry wrote:Thanks very much. This is very useful.JGoode wrote:All of the hotspots need to have the same base co-ordinates.
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.
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 1or! 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 + 1Adding a flag value of 512 to the centre hotspot (type 6) will make it rotate in the opposite direction.
Barry.
ArchiCAD 23
Windows 10
Windows 10