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

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Range values into arrays

Anonymous
Not applicable
I try to introduce a range value into an array, without success.
(for eg. with graphical hotspots, possibility to increase each angle value by step 10 degrees, or custom)
I can do it for a single object, but unfortunately, not into an array.
According to the manual, it seems difficult, because no variable are allowed.
I am not sure to interpretate this correctly, so i hope there is perhaps a workaround.
Any info appreciated.
4 REPLIES 4
Jochen Suehlo
Advisor
I tried it and it seem to work:
Define a parameter "q" array in the Parameters list.
Then write in the Parameter Script something like this:

VALUES "q" 1,2,3,RANGE(5,7)

If you want to change each array parameter you have to make an Interface Script, where you write something like this:

UI_DIALOG ""

UI_INFIELD{2} q[1], 10,10,80,20
UI_INFIELD{2} q[2], 10,30,80,20
UI_INFIELD{2} q[3], 10,50,80,20
UI_INFIELD{2} q[4], 10,70,80,20
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Anonymous
Not applicable
Thanks for answering, Joachim.
I will try your solution tomorrow, and tell you.
Thanks again.
Jochen Suehlo
Advisor
There seems to be a bug in ArchiCAD:
To use movable hotspots together with the VALUES command and RANGE is no problem.
But if you use movable hotspots together with the VALUES command and RANGE and you use Array parameters within the VALUES command the VALUES command will have no function while moving your hotspots in 2D or 3D.
An example:
Define an array parameter named "angle" with 2 rows (angle[2]),
write in the Parameter Script:

VALUES "angle" RANGE [0, 360] STEP 360, 10
this does not work if you use movable hotspots,
you have to do a workaround instead:

FOR i=1 TO 2
FOR k=0 TO 35 STEP 1
IF angle>10*k+5 AND angle<=10*(k+2)-5 THEN angle=10*(k+1)
PARAMETERS angle=angle
NEXT k
NEXT i

The 2D Script with the editable hotspots look like this (from the gdl manual):

LINE2 0, 0, A, 0
LINE2 0, 0, A*COS(angle[1]), A*SIN(angle[1])
ARC2 0, 0, 0.90*A, 0, angle[1]
ARC2 0, 0, 0.60*A, 0, angle[2]

unID=1
HOTSPOT2 0, 0, unID : unID=unID+1 ! anchor point

HOTSPOT2 0 , 0 , unID, angle[1], 6 : unID=unID+1
HOTSPOT2 0.9*A , 0 , unID, angle[1], 4 : unID=unID+1
HOTSPOT2 0.9*A*COS(angle[1]), 0.9*A*SIN(angle[1]), unID, angle[1], 5 : unID=unID+1

HOTSPOT2 0 , 0 , unID, angle[2], 6 : unID=unID+1
HOTSPOT2 0.6*A , 0 , unID, angle[2], 4 : unID=unID+1
HOTSPOT2 0.6*A*COS(angle[2]), 0.6*A*SIN(angle[2]), unID, angle[2], 5 : unID=unID+1

Has anyone another solution?
Graphisoft, please put this into your bug list!
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Anonymous
Not applicable
Thanks for the help and the private exchanges, Joachim, the workaround is great.
It would be easier to use directly value command with range definition into arrays,
because the ability to use also a custom value if needed.
GS, please, is there an issue to fix it?