We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.

Global User Variables

DGSketcher
Legend

I am trying to set up a system where a number of different GDL objects can access common values. These values need to be accessible for updating with all the connected objects following the changes. I have a set up using MVO and the objects pulling values with the LibraryGlobal command. This is working great, until I change to a different MVO setting at which point all the values revert to their default / last changed values for that MVO. This can destroy my drawings (not literally), until all the variables are updated. Is there a practical alternative or some way of feeding back values so that all MVO selections use the same values? 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
14 REPLIES 14

Have you tried reading a file in the embedded library? Is it still slow then?

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

@Peter Baksa I am no GDL expert, so please forgive if I am missing something.

Would your suggestion be using the CALL command?

Looking back on the discussions in this thread I no longer see that as a solution. What we need is somewhere to deposit project globals but also have access to them through a user (friendly) interface. Without the MVO link I don't see any other logical route as Macros can't be placed and placed GSM files don't allow editing their source parameters. There will be a few interested readers here if you have a neat trick the rest of us are missing?

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

You wrote:


I can't justify external file I/O (too slow) to save the values

I thought maybe reading a file from the embedded library OPEN(..., ..., "LIBRARY, MODE=RO") would be faster, because reading external files disables multi-threaded gdl execution: http://gdl.graphisoft.com/gdl-style-guide/background-conversion

 

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

Thank you Peter, I will have a play with that as soon as I have time and report back. In my head there may be a Project Global solution that could work with a placed object and the UI script. 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

So I have had a play with this "Library" idea, but it looks like it is necessary to open each object or a selection of matching objects to get them to update. The advantage of using the MVO is all the affected objects are automatically rebuilt after a change in settings. The MVO is also a lot easier to manage / code.

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)