GDL
About building parametric objects with GDL.

Using global variables in parameter scripts

Bhtsz_pyd
Contributor

Hi!

Is there any way to use global variables in the parameter script?

4 REPLIES 4
Barry Kelly
Moderator

Some you can and some you can't.

In the GDL manual you will be told which ones can't.

 

BarryKelly_0-1728607068189.png

 

https://gdl.graphisoft.com/reference-guide/global-variables

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Thanks Barry. But the variable I want to use does not work in the parameter script. My question is actually I wonder if there is a way to use variables that do not work in the parameter script. The script I want to write is "parameters ac_toplevel= zzyzx + GLOB_HSTORY_ELEV"

Yves
Advocate

Hi,
you can write your example in the master script

Yves Houssier
Belgium
Archicad 19 -> 24
iMac - Mac Os 10,13

GLOB_HSTORY_ELEV will return "0" in the parameter script (and the mater script).

 

BarryKelly_0-1728642341373.png

 

Only in the 2D or 3D script will it have a value.

So you can use in in 2D or 3D but you can not set another parameter based on its value.

 

Also don't just type...

parameters ac_toplevel= zzyzx + GLOB_HSTORY_ELEV

 

You should type ...

ac_toplevel= zzyzx + GLOB_HSTORY_ELEV

parameters ac_toplevel= ac_toplevel

 

This set the parameter value used in the scripts and also set the parameter value in the parameter list.

But even this won't work in this instance because GLOB_HSTORY_ELEV will always be 0 in the parameter script.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11