Choose your top Archicad wishes!

Read more
About building parametric objects with GDL.

Called Hotspots don't work with dimensions?


Can someone confirm if it is possible to create 2D/3D hotspots in a called macro that associate with dimensions? At present I am seeing the required macro hotspots in the model (each generated with unique ids) but the dimension tool ignores them. Other tools seem quite happy to work with the hotspots.

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

I have no issues with any objects hotspots, dynamic or not, not linking with dimensions

Thanks for the reassurance. Do you have any tips on how you handle the unique Hotspot IDs between the parent & macro?

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

You can call the macro with a starting number for the hotspot IDs.

You'll only need one additinal parameter. This works totally fine.

If the number of hotspots inside the macro is dynamic and you don't know how many there are in advance you can either return the final hotspot ID from the macro.


Hotspots need to be unique, from v25 on this will be especially enforced.

But they don't need to be consecutive. This means you can just "reserve" a "corridor" for the hotspots. Example code below.


! example
unID = 1
hotspot2 ... unID : unID=unID+1
call "macro" parameters startID = unID returned_parameters unID_ret

unID = unID_ret
!----- OR -----!
! (without ID handover and returned_parameters)

call "macro"

unID = unID + 1000
! where 1000 is a number you know won't be exceeded


However with macros which are not done by you it's quite tricky, because the way it's programmed might collide with your unique IDs.

The solution then is to start in your main GDL with a really high number for the hotspot ID.

Again: the IDs don't need to be consecutive, nor do they even need to be in ascending order.


Still the corridor/fixed offset method has one advantage:

Since the ID is used to bind the dimension to this place you won't lose important dimensions or have them re-placed randomly when changing the object.


Hotspots •

Consecutive Hs IDs:
1    2   3   4    5   6    7   8

Object changed:
1    2   3    4    5         [new IDs]
1    2   3 4? 5 6? 7 8?      [old IDs]
Dimensions bound to ID 4 and onwards will be placed wrong!

Fixed offset:
1    10  11  12   30  31   50  51

Object changed:
1   10   11   30   50       [new IDs]
No dims re-placed  🙂 
Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs |

«Furthermore, I consider that Carth... yearly releases must be destroyed»

@runxel Thank you for the clarity & tips. The hotspots were limited so I have done a subroutine in the parent for now. The problem I was getting was using multiple calls to the same macro I couldn't get the unID to advance, I just kept getting duplicate unID warnings. These were also valid warnings as the dimensions didn't associate with the picked points. Obviously user error. I will revisit this shortly as it will clean up the code but for now I need to get the associated drawings out. Thanks again.

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

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!