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

Master_GDL usage for user global variables

Robert Nichols
Advocate
I'm trying to use Master_GDL script for the first time. My goal is to set a value for a user global variable in the master script, and have subsequent scripts run during 3d window generation and use the value.

My first effort is not working, and I suspect I'm missing something obvious.

Script:
- created with gel editor
- name is "MASTER_GLD"
- object subtype set to "LIBRARY MASTER"
- variable is set in master script (only script space available)
- "GLOB_USER_1=5" is code used


But GLOB_USER_1 evaluates to 0 when accessed in another script.
What's wrong?
Mac Studio, 32gb ram, ArchiCAD v26 (Apple Silicon) MacOS 13
2 REPLIES 2
Barry Kelly
Moderator
Two things I can think of.

If you have just created this Master_GDL object then you need to reload your library to start it working.
It is only read when you start Archicad or reload the library.

The second is make sure you don't use quotes around GLOB_USER_1=5 (I am sure that was just for your example).

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
Laszlo Nagy
Community Admin
Community Admin
There were changes in ARCHICAD 19 to how GLOB_USER parameters work:

Check Section IV. User Globals:

http://gdl.graphisoft.com/wp-content/uploads/GDL-changes-in-ArchiCAD-19-v1.1.pdf

It also states that:
The use of user globals for data transfer between an element and its macros is obsolete, slow to interpret, and hard to debug. The best practice is:
o For data transfer from the caller element to the macro, simply add the parameters to the macro call
o For data transfer from the macro to the caller element, add the returned parameters to the macro call
o To centrally set a value for all parts of a library:
 Use the Library Master object to set fixed values and value lists for all of your objects
 Use the Library Globals set in Model View Options to have editable parameters affecting all Library parts using that Model View.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28