BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

About building parametric objects with GDL.

Editable hotspots disappearing


I noticed the very strange behavior of editable hotspots. Written on ArchiCAD 21 it did behave OK. But later, in ArchiCAD 23 & 24 editable hotspots have disappeared.
The reason is that the hotpots existed inside of two IF - ENDIF conditions:

     IF ... THEN
        HOTSPOT ...

As soon as I removed one IF, hotspots appeared in ArchiCAD 24 again.

Is it considered as a software bug or it is change in how ArchiCAD interprets editable hotspots creating and all GDL scripts must follow this logic now - to depend ONLY on one IF ?
I just made a test where I ensured both IFs resolve to true.
The hotspot was there in plan.
Not sure whats going on there for you.
Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»
Sorry, I was wrong. Three IFs instead of two. And also FOR - NEXT.

This is the code that is not working anymore in ArchiCAD 23 and 24:

	IF _show THEN

		IF NOT(ap_explodeCoorZ) THEN

			ADD wallStart+(wallEnd-wallStart)/2, 0, wallTop/2

			FOR i=1 TO 2

				IF i=2 THEN ADDY -ap_panelThickness

				HOTSPOT 0, 0, 0, 1000*i+1, ap_explodeCoorY, 1+128 
				HOTSPOT 0, -0.1, 0, 1000*i+2, ap_explodeCoorY, 3 
				HOTSPOT 0, ap_explodeCoorY, 0, 1000*i+3, ap_explodeCoorY, 2

				IF i=2 THEN DEL 1

			NEXT i

			DEL 1


		IF NOT(ap_explodeCoorY) THEN

			ADD wallStart+(wallEnd-wallStart)/2, -ap_panelThickness/2, wallTop

			HOTSPOT 0, 0, 0, 1011, ap_explodeCoorZ, 1+128 
			HOTSPOT 0, 0,-0.1, 1012, ap_explodeCoorZ, 3 
			HOTSPOT 0, 0, ap_explodeCoorZ, 1013, ap_explodeCoorZ, 2

			DEL 1



I also noticed that in some cases editable hotspots defined in macro script been shown and worked fine in ArchiCAD 21, and in latest versions turned into simple hotspot but still acting as editable hotspots or sometimes even stopped working as editable hotspots.
Is there a reason there are no unID for your editable hotspots?

I was always with the understanding that they are essential to properly use editable hotspots
I have nested hotspots with in groups and looped and looped and have no issues.

The only time my hotspot struggle and I'm pretty sure it's just accessories but if I have my model floor plan on core only then I cannot edit a hotspots in 3D
SenecaDesignLLC wrote:
Is there a reason there are no unID for your editable hotspots?

I was always with the understanding that they are essential to properly use editable hotspots
No, they have unID. It's 1000*i+1, 1000*i+2, 1000*i+3 and 1011, 1012, 1013

In the first loop I'm getting 1001, 1002, 1003 and 2001, 2002, 2003

And I didn't find them exactly in core-only view, as you mentioned. But I'm not sure is it really an issue - I need to take a look at this.
i copied and pasted your code and seem to not have issues with the hotspots working. here is the test object. maybe there is something else in play.
I don't have time to test your script but I can make 2 suggestions:

1. unID's shouldn't be set as a multiple of the loop (Though I do this in Infinite Openings) as there are possibilities for doubling up of ID's. I set a base unID at the start of the script (3D in this case) and then add a count every time an ID is required

eg. hotspot, x, y, z, unID, paramReference: unID = unID +1

Though I don't think this is the issue for your code. so perhaps suggestion 2 might help.

2. I have noticed errors occur when I combine loops with conditional statements on single lines. By that I mean I try to write a single line of code like this:

if x = y then: parameters a = b, c = d, e = f: endif

This works fine but for some reason it does not get computed inside a loop and therefore no values are returned and this often results in a error (but that is script specific). It also happens with or/else/and statements in a line.

SO perhaps it is your first line of code "IF... AND... AND... THEN"

Try breaking this up into separate lines and then also try quarantining the whole code (hide with !) and then slowly unravel (unhide line by line) it from the end (Hotspot commands) to see where it trips ups.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
Strange. I need to look into the code again. It's a Structural Insulated Wall Panel in my library. Choosing Explode mode in MVO it should show hotspots, that let to move the panel up or on side - to create 3D explode.

In the old project file, where I used these panels, all hotspots disappeared. In the new file hotspots are shown, but I cannot move them - after I move, they stay in the same position.
It definitely something wrong in the code. Maybe because I'm using NOT(ap_explodeCoorZ) for floating point number (length).
Learn and get certified!