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

GDL
About building parametric objects with GDL.

Editable hotspots disappearing

Podolsky
Ace
Hi!

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
     IF ... THEN
        HOTSPOT ...
     ENDIF
ENDIF

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 ?
9 REPLIES 9
runxel
Legend
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»
Podolsky
Ace
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 ap_explodeMode AND (GLOB_VIEW_TYPE=3 OR GLOB_VIEW_TYPE=6) AND GLOB_PREVIEW_MODE<>1 THEN

	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

		ENDIF

		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

		ENDIF

	ENDIF

ENDIF
Podolsky
Ace
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
Podolsky
Ace
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.

https://bit.ly/2RUHs9i
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
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists
Podolsky
Ace
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).