The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Everything about GDL - Doors/Windows/Objects/Stairs etc. (Example: I created an object that prints an error message in 3D all the time, please help!)

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, Gergely Feher

User avatar
By adambutler

I have an annoying problem where sometimes the glob_user variables are not getting set. Any help would be appreciated. The scenario is as follows:

I have a library part which exists on all our plans. It contains a parameter which states whether the drawing has been published or not. By published I mean approved - internal lingo.

In the master script for this library part I say something like:
if published then
if drawing_type_a then
glob_user_2 = 1
glob_user_2 = 99
glob_user_2 = 0

Several library parts show error messages when glob_user_2 is set to 0, this forces the users to publish the drawing (the published parameter gets set when management publishes this drawing. it is locked for all other users)

In a different library part I say something like:

if str(glob_user_2,1,0) = "0" then
text2 0,0,"NOT PUBLISHED"

I have a drawing that is published. On opening a drawing our apx does a programmatic rebuild and regen, but one of my library parts that does this check still has the error. This has happened before, most times everything works fine.

The 'NOT PUBLISHED' text goes away after doing a manual rebuild/regen.

I have checked through our entire library and am certain that nothing else is setting glob_user_2.

Has anyone had similar problems when using global variables?
Is this an ok use of global variables in gdl?
We are using ArchiCAD 7, does anyone know if a problem like this was fixed in ArchiCAD 9? (we are in the process of upgrading)

Any insight would be much appreciated.