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

How to save Macro’s new values after closing the dialogue and without placing it in the model?

Nader Belal
Mentor

Hi everyone,

 

This question is expected to be answered by professionals GDL programmers only.

 

Case:

I have created a macro that should act as data repository, instead of using Archicad’s database or text I/O plug-ins for practicality reasons. And that macro would output to the caller library part a specific set of data that is to be provided by the caller library part.

 

The problem that I’m facing is that in case that if the user wants to update the macro’s data values, s/he would need to open it using the GDL Editor, modify the values (UI is provided), then save it/overwrite it.

 

Desires:

I would like to know if there is a way, that the user would only have to edit those values using library parts, and they would automatically be saved, without the need of placing that macro in the plan or in the model?

 

 

A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Maybe library global is the key? some update button there?

So the original content in csv...loads on demand and updates the content...

or even plain edit it as You have the UI...and UI in LG can be natively bigger  😛

View solution in original post

6 REPLIES 6
Solution

Maybe library global is the key? some update button there?

So the original content in csv...loads on demand and updates the content...

or even plain edit it as You have the UI...and UI in LG can be natively bigger  😛

Barry Kelly
Moderator

A macro can be a place-able library part, but when called from another library part, it will not call the placed instance, it will call the default macro in the library - with its default values.

So the only way to change values in that macro object is to open and edit the library part (macro) itself.

 

But if it is a macro, you could have the parameters in the master object that makes the call.

It will pass those values on to the macro with the call, so there is no need to modify and save the actual macro.

You just set what you want in the master object.

That way each instance of the master object can have its own settings.

But I get the feeling that may not be what you want.

 

As Piotr suggested, you could create Library Global variables in the Model View Options.

You can set the value in the MVO and all objects can read it.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

@Barry Kelly 
In my case, putting the values in the caller defeats the whole purpose. Piotr idea just nails it

A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
JaseBee
Advocate

Do you find that utilising the library global as a database slows things down?

 

Last time I tried to store lots of values as a sort of master set for numerous parts in a library global it seemed to get clunky.

 

Sorry to chime in after it's been solved, have been toying with ways of getting objects to talk to each other for some time.

AC 24 5004 AUS
iMac OSX (10.13.6) 4.2ghz i7
8gb ram/8gb vram

Depends how big is the database...have in mind that the matrix parameters passing has some restrictions.

I use it for changing the library language on the fly.

There may be a slowdown loading MVO - but it happens when there are a lot ui_infields for parameters visible. (I sometimes do a command to open edit to get it faster)

JaseBee
Advocate

Excellent, thanks for the explanation Piotr. I'll give these ideas a go in my next attempt.

AC 24 5004 AUS
iMac OSX (10.13.6) 4.2ghz i7
8gb ram/8gb vram