Home › Forums › Problems and solutions in GDL › Informations from the environment › What is the proper replacement for GLOB_CONTEXT=1? › Reply To: What is the proper replacement for GLOB_CONTEXT=1?
I use it to check settings in existing objects and modify them to new values then set a ‘flag’ parameter to say it has been done so it does not get checked again.
I don’t want this to happen in the GDL editor as I need to save the object with the ‘flag’ parameter set to 0 so I filter that with GLOB_CONTEXT <> 1.
This way it does not reset in the GDL editor but only when the object scripts are run in the model.
!!set page type for existing objects so they don't default to wrong object if GLOB_CONTEXT <> 1 then if flag = 0 then if category = "LIGHTING" then if ind_objects = "MOTION SENSOR" then page_type = "SUPERSEDED" else page_type = "LIGHTING" endif endif if category = "POWER" then page_type = "POWER" endif if category = "DATA & SECURITY" then if ind_objects = "NX4 ALARM PANEL" then page_type = "SUPERSEDED" else page_type = "DATA & SECURITY" endif endif if category = "TELSTRA VELOCITY" then if STRSTR(ind_objects, "TELSTRA VELOCITY") > 0 then page_type = "SUPERSEDED" endif endif PARAMETERS page_type = page_type flag = 1 PARAMETERS flag = flag endif endif
A similar situation was posted here in Archicad Talk … https://archicad-talk.graphisoft.com/viewtopic.php?t=50571
Versions 6.5 to 22
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit