2021-12-06 06:02 PM
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.
2021-12-06 07:30 PM
I have no issues with any objects hotspots, dynamic or not, not linking with dimensions
2021-12-07 10:26 AM
Thanks for the reassurance. Do you have any tips on how you handle the unique Hotspot IDs between the parent & macro?
2021-12-07 05:19 PM
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 🙂
2021-12-07 06:03 PM
@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.