Global Variables

The global variables make it possible to store special values of the model.
This allows you to access geometric information about the environment of the GDL macro.
For example, you can access the wall parameters when defining a window which has to fit into the wall.
Global variables are not stacked during macro calls.
For doors, windows, labels and property library parts there is one more possibility to communicate with ARCHICAD through fix named, optional parameters. These parameters, if present on the library part’s parameter list, are set by ARCHICAD.
See the list of fix named parameters and more details in the section called “Fix named optional parameters”.

Script compatibility

View or project dependent global variables should not be used in parameter scripts (or master scripts run as parameter script)
to avoid the parameter script run occasions and the resulting parameter values becoming context dependent, inconsistent within the planfile.
Compatibility up to ARCHICAD 19: Such globals accidentally used in parameter script generate GDL warnings.
Compatibility starting from ARCHICAD 20: Such globals used in parameter script generate GDL warnings, and will contain a static default value (type-matching).
Compatibility starting from ARCHICAD 22: View dependent global variables should not be used in property scripts (or master scripts run as property script). Such instances will cause warnings in scripts. However, project dependant variables are enabled in property script most cases.
For compatibility details, check out the global variable descriptions. Script type restrictions apply where indicated.

Legend:
GDL_CheckIcon works without restriction
GDL_WarningIcon works (with additional warning)
GDL_ErrorIcon contains a dummy default only (with additional warning)

 

Example usage of global variables

Illustrating the usage of the GLOB_WORLD_ORIGO_… globals

ADD2 -GLOB_WORLD_ORIGO_OFFSET_X-SYMB_POS_X, -GLOB_WORLD_ORIGO_OFFSET_X-SYMB_POS_Y
LINE2 -0.1, 0.0, 0.1, 0.0
LINE2 0.0, -0.1, 0.0, 0.1
HOTSPOT2 0.0, 0.0, 1
TEXT2 0, 0, "( 0.00 ; 0.00 )"
TEXT2 0, 0.5, "World Origin"
DEL TOP
if ABS(GLOB_WORLD_ORIGO_OFFSET_X) > 0.01 OR \
   ABS(GLOB_WORLD_ORIGO_OFFSET_Y) > 0.01 THEN
    ADD2 - SYMB_POS_X, - SYMB_POS_Y
    LINE2 -0.1, 0.0, 0.1, 0.0
    LINE2 0.0, -0.1, 0.0, 0.1
    HOTSPOT2 0.0, 0.0, 2
    TEXT2 0, 0, "(" + \
            STR (GLOB_WORLD_ORIGO_OFFSET_X, 9, 4) + "; " + \
            STR (GLOB_WORLD_ORIGO_OFFSET_Y, 9, 4) + " )"
    TEXT2 0, 0.5, "Virtual Origin"
    DEL TOP
ENDIF
if ABS(GLOB_WORLD_ORIGO_OFFSET_X + SYMB_POS_X) > 0.01 OR \
   ABS(GLOB_WORLD_ORIGO_OFFSET_Y + SYMB_POS_Y) > 0.01 THEN
    LINE2 -0.1, 0.0, 0.1, 0.0
    LINE2 0.0, -0.1, 0.0, 0.1
    HOTSPOT2 0.0, 0.0, 3
    TEXT2 0, 0, "(" + \
            STR (GLOB_WORLD_ORIGO_OFFSET_X + SYMB_POS_X, 9, 4) + "; " + \
            STR (GLOB_WORLD_ORIGO_OFFSET_Y + SYMB_POS_Y, 9, 4) + " )"
    TEXT2 0, 0.5, "Object Placement"
ENDIF