We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

GDL: Hotspot Dynamic paramReference

Lingwisyer
Guru

Hi all,

 

Is there a way to use a dynamic paramReference in a Hotspot?

 

 

IF lp1_uniform_b = 1 then
			linepart1 = lp1_uniform
		ELSE
			linepart1 = lp1[i][3]
endIF
IF lp2_uniform_b = 1 then
			linepart2 = lp2_uniform
		ELSE
			linepart2 = lp2_h[i][3]
endIF

HOTSPOT2 (marker_length - linepart1 - linepart2) * GLOB_SCALE,		lsg_elevation,								lsg_uID,	lp2_v[i][3],	1+128+1024					: lsg_uID = lsg_uID +1	!base

HOTSPOT2 (marker_length - linepart1 - linepart2) * GLOB_SCALE,		lsg_elevation + lp2_v[i][3] * GLOB_SCALE,	lsg_uID,	lp2_v[i][3],	2+1024						: lsg_uID = lsg_uID +1	!Left moving

HOTSPOT2 (marker_length - linepart1 - linepart2) * GLOB_SCALE,		lsg_elevation-1,							lsg_uID,	lp2_v[i][3],	3+1024						: lsg_uID = lsg_uID +1	!ref

 

 

I would rather not need to duplicate all of my hotspots for the four different variations... an extra 168 lines...

 

 

Ling.

 

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
1 REPLY 1
Lingwisyer
Guru

I worked out how to consolodate the relevant hotspots into a subroutine, so I have only gained 20 lines.

 

 

j = 3
k = -1
goSUB "Marker_Line"
"Marker_Line":
IF lp1_uniform_b = 0 & lp2_uniform_b = 0 then
HOTSPOT2 (marker_length - lp1[i][j]) * GLOB_SCALE * (-1 * k),					lsg_elevation,								lsg_uID,	lp2_h[i][j],		1+128+1024		: lsg_uID = lsg_uID +1	!base

HOTSPOT2 (marker_length - lp1[i][j] - lp2_h[i][j]) * GLOB_SCALE * (-1 * k),		lsg_elevation,								lsg_uID,	lp2_h[i][j],		2+1024			: lsg_uID = lsg_uID +1	!Right moving

HOTSPOT2 (marker_length * GLOB_SCALE + 1) * (-1 * k),							lsg_elevation,								lsg_uID,	lp2_h[i][j],		3+1024			: lsg_uID = lsg_uID +1	!ref

 

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660