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”.

Parameter 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).

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

 

View dependent globals ARCHICAD 18 ARCHICAD 19 ARCHICAD 20
Parameter Script Parameter Script Parameter Script Default
GLOB_CONTEXT GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 2
GLOB_VIEW_TYPE GDL_WarningIcon GDL_WarningIcon
GLOB_SCALE GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 100
GLOB_DRAWING_BGD_PEN GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 19
GLOB_FRAME_NR GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon -1
GLOB_FIRST_FRAME GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0
GLOB_LAST_FRAME GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0
GLOB_EYEPOS_X GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon -5.0
GLOB_EYEPOS_Y GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon -5.0
GLOB_EYEPOS_Z GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 1.7
GLOB_TARGPOS_X GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0.0
GLOB_TARGPOS_Y GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0.0
GLOB_TARGPOS_Z GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 1.7

 

Project dependent globals ARCHICAD 18 ARCHICAD 19 ARCHICAD 20
Parameter Script Parameter Script Parameter Script Default
GLOB_NORTH_DIR GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 90
GLOB_PROJECT_LONGITUDE GDL_WarningIcon GDL_ErrorIcon 0
GLOB_PROJECT_LATITUDE GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0
GLOB_PROJECT_ALTITUDE GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0
GLOB_PROJECT_DATE GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon [0; 0; 0; 0; 0; 0]
GLOB_WORLD_ORIGO_OFFSET_X GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0
GLOB_WORLD_ORIGO_OFFSET_Y GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0
GLOB_CUTPLANES_INFO GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon [1.0; 3.0; -0.1; -0.1]
GLOB_STRUCTURE_DISPLAY GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0
GLOB_ISSUE_SCHEME GDL_CheckIcon GDL_CheckIcon GDL_CheckIcon
GLOB_CHANGE_SCHEME GDL_CheckIcon GDL_CheckIcon GDL_CheckIcon
LAYOUT_REVISION_HISTORY GDL_CheckIcon GDL_CheckIcon GDL_CheckIcon
LAYOUT_CHANGE_HISTORY GDL_CheckIcon GDL_CheckIcon GDL_CheckIcon
LAYOUT_CURRENTREVISION_OPEN GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon FALSE
GLOB_HSTORY_ELEV GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0
GLOB_HSTORY_HEIGHT GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 3.1
GLOB_CSTORY_ELEV GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0.0
GLOB_CSTORY_HEIGHT GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 3.1
GLOB_CH_STORY_DIST GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 0.0
GLOB_SUN_AZIMUTH GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 240.0
GLOB_SUN_ALTITUDE GDL_CheckIcon GDL_WarningIcon GDL_ErrorIcon 35.0

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