GDL
About building parametric objects with GDL.
SOLVED!

Dynamic hotspots behaving erratically

Kaj_AL
Enthusiast

Hello everyone!

I have a quite complex object where I had hotspots controlling height, which behaved weirdly. I tried to make a new, much simpler object, and I still have the same problem, and I can't figure out why.

My hotspots are supposed to be in the corners of the object och every level, but they keep jumping in the Z direction, and I can't see a pattern of it. Can anyone figure out why? It's really annoying me.

 

 

!3D SCRIPT

DIM shape[][]

shape[1][1]=0
shape[2][1]=0
shape[3][1]=15
shape[1][2]=A
shape[2][2]=0
shape[3][2]=15
shape[1][3]=A
shape[2][3]=B
shape[3][3]=15
shape[1][4]=0
shape[2][4]=B
shape[3][4]=15
shape[1][5]=0
shape[2][5]=0
shape[3][5]=-1

FOR i=1 TO 5
	PUT shape[1][i], shape[2][i], shape[3][i]
NEXT i

FOR i=1 TO num_stories
	PRISM_ 5, story_height[i],
		USE(NSP)
	ADDZ story_height[i]
NEXT i
DEL num_stories

unID=0

FOR i=1 TO num_stories
	current_height=0
	FOR j=1 TO i
		current_height=current_height+story_height[i]
	NEXT j
	FOR k=1 TO 4	
		!Story height hotspots
		unID=unID+1 : HOTSPOT shape[1][k], shape[2][k], current_height-story_height[i], unID, story_height[i], 1 + 128
		unID=unID+1 : HOTSPOT shape[1][k], shape[2][k], current_height, unID, story_height[i], 2
		unID=unID+1 : HOTSPOT shape[1][k], shape[2][k], -1, unID, story_height[i], 3			
	NEXT k
NEXT i

 

 

My only parameters are the standard A and B for the size, story_height (an array of lengths) and num_stories (an integer between 1-10)

Kaj_AL_0-1724422892250.png

Thank you!

/Kaj

Archicad 24-27 SWE
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
runxel
Legend

Because in your last for loop you are doing another one, this is unnecessary.

So the `current_height = current_height+story_height[i]` can run in the main loop (which already runs over all stories...).

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

View solution in original post

2 REPLIES 2
Solution
runxel
Legend

Because in your last for loop you are doing another one, this is unnecessary.

So the `current_height = current_height+story_height[i]` can run in the main loop (which already runs over all stories...).

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

Oh. Bah. That was embarrassingly simple, I don't even know why I though I needed to complicate it like that. Thank you so much!

Archicad 24-27 SWE
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!