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

GDL Parameter with text

Anonymous
Not applicable
Hello,

I would like to create a parameter like integer but with text,

Like:

Option a: Left, Center, Right.

and then use it for my 3d script.

with integer i can only do it with 1, 2 or 3 not with text. Is there anyone that can help me please?

Thanks
10 REPLIES 10
David Maudlin
Rockstar
Luís:

This can be done in the Parameter Script, in the GDL Reference Guide look at the VALUES command. In your case something like:

Values "Position" "Left", "Center", "Right"

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
I already tried it, I created a values thing, but that it says variable not initialized, how can I link that to a parameter?!? I'm not getting that part.

Thanks for the help
David Maudlin
Rockstar
Luís:

You need to create a parameter (Position in my example) and set its Type to Text. Note the use of quotes and commas (GDL is unforgiving). Post some screen shots of your main Library Part window (showing the parameters), Parameters Script and error message.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
I found it! Didn't know I had to add " to the variables! Now I'm having problems creating hotspots that I can move and that change the A ou B parameter... the sintax is a bit confusing, I have bought the GDL Handbook from Cadimage, but I can't break it down to something I would understand:

!Dynamic hotspot to adjust length_variable along the x-axis
add 2
reference_point_x, reference_point_y
hotspot2 0, 0, hotspotIndex + 1, length_variable, 1 hotspot2 length_variable, 0, hotspotIndex + 2,
length_variable, 2
hotspot2 -1, 0, hotspotIndex + 3, length_variable, 3 hotspotIndex = hotspotIndex + 3
del 1

For instance what is hotspotIndex?

Thanks again!
Erich
Booster
Each hotspot gets a unique numeric identifier (ie. 1, 2, 3, etc.)

Try this
unID = 1
!! X movement
HOTSPOT  0,   0, 0, unID, varx, 1 : unID = unID+1 !base
HOTSPOT  varx, 0, 0, unID, varx, 2 : unID = unID+1 !move
HOTSPOT -1,   0, 0, unID, varx, 3 : unID = unID+1 !reference

!! Y movement
HOTSPOT 0,  0,   0, unID, vary, 1 : unID = unID+1 !base
HOTSPOT 0,  vary, 0, unID, vary, 2 : unID = unID+1 !move
HOTSPOT 0, -1,   0, unID, vary, 3 : unID = unID+1 !reference

!! Z movement
HOTSPOT 0, 0,  0,   unID, varz, 1 : unID = unID+1 !base
HOTSPOT 0, 0,  varz, unID, varz, 2 : unID = unID+1 !move
HOTSPOT 0, 0, -1,   unID, varz, 3 : unID = unID+1 !reference
This will give you three hotspots for the variable "vary", vary", and "varz"
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
David Maudlin
Rockstar
luisfmoreira wrote:
Now I'm having problems creating hotspots that I can move and that change the A ou B parameter
If you are using the A and B parameters (basic width and depth), then you don't need additional code, they are already inherently stretchable if used as the boundaries of the object.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
I made it, but I don't understand it completely! I wanted to use other parameters, not only A and B!

I will paste the code later, maybe someone can help me improve it! GDL is extremely flexible but it's a shame we can't edit it graphically (like with stretchable blocks in autocad!) but I'm enjoying it a lot!
Anonymous
Not applicable
I've tried using what u guys gave me to code a stretching piece of furniture, but it's always backwards!!! It stretches to the oposite size
When I stretch it to the right it goes left! Any ideas


hotspotIndex=1

hotspot A, -0.06, 0, hotspotIndex + 1, SOCLD, 1
hotspot SOCLD, -0.06, 0, hotspotIndex + 2, SOCLD, 2
hotspot -A-SOCLD, -0.06, 0, hotspotIndex + 3, SOCLD, 3

hotspotIndex = hotspotIndex + 3

PRISM_ 4, HSOCL,
0.00, 0.00 , 24,
A + SOCLD, 0.00 , 24,
A + SOCLD, ES , 15,
0.00, ES , 15
rocorona
Booster
Mate, you are really over-complexing it... It is clear that you don't have a good feeling with GDL, but I admire your efforts, and encourage you to go on.

First of all, I can't understand why you added the A variable to your desired lenght.
try this:
hotspotIndex=1	

hotspot        0, -0.06, 0, hotspotIndex + 1, SOCLD, 1 
hotspot    SOCLD, -0.06, 0, hotspotIndex + 2, SOCLD, 2 
hotspot       -1, -0.06, 0, hotspotIndex + 3, SOCLD, 3 

hotspotIndex = hotspotIndex + 3 

PRISM_ 4, HSOCL, 
  0.00,  0.00 , 24, 
  SOCLD, 0.00 , 24, 
  SOCLD, ES ,   15, 
  0.00,  ES ,	15
Then, well, I know this is only a sniplet of the code, but to start with the simplest, I suggest you to practice with the standard variables for length (A) width (B) and height (ZZYZX), instead of define your own (SOCLD, ES, HSOCL).

Finally, for very basic resize function, provided you used A,B,ZZYZX for the global sizes, one can use a macro provided by Graphisoft (is hidden in the standard library) with the simple command:
CALL "Resize_A_B_ZZYZX" PARAMETERS ALL
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________