Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Called Hotspots don't work with dimensions?

DGSketcher
Virtuoso

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 macOS Big Sur / AC24UKI (most recent builds)
4 REPLIES 4

SenecaDesignLLC
Advisor

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

FREE wall Accessory framing and coverings
bit.ly/BIMRithmWallAccessories

FREE Truss object.
https://bit.ly/BIMRithmTrussV1
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

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

Apple iMac macOS Big Sur / AC24UKI (most recent builds)

runxel
Mentor

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.

Or....

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.

E.g.

Hotspots •
(Macros)

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  🙂 
AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

DGSketcher
Virtuoso

@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 macOS Big Sur / AC24UKI (most recent builds)

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!