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

Editable hotspots disappearing

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

Podolsky
Newcomer
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
Newcomer
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.

SenecaDesignLLC
Enthusiast
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
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

SenecaDesignLLC
Enthusiast
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
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

Podolsky
Newcomer
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.

SenecaDesignLLC
Enthusiast
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
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

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
Newcomer
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).

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!