cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

about calling macros

Anonymous
Not applicable
I’m creating a railing GDL object. The railing calls different macros to use as balusters. Each baluster type has different structural dimensions. I’m planning to make many different balusters so I don’t want to change every time my main railing GDL code. So:

a. Is there a way each time I call a macro, the macro to “inform” the main railing GDL code about its structural dimensions? Now I use the master script and code such as – if balustertype = “baluster 01” then balusterwidth=……….-

b. In the parameter script is there a way to read and list macros from a particular directory instead of using -values “balustertype” ‘baluster 01’, ‘baluster 02’,…….-?

thank you in advance
2 REPLIES 2
TomWaltz
Participant
Yes, in Archicad 10 you can have a Macro send a value back to the object that called it. I've not used it yet myself, but the syntax for the "CALL" statement is on page 218 of the GDL manual.
CALL macro_name_string [,] PARAMETERS [name1=value1 , ... namen=valuen][[,] RETURNED_PARAMETERS r1, r2, ...] 
and END/EXIT
END / EXIT [v1, v2, ..., vn]
I have no idea what the difference is 😉 There are no examples in practice that I can find, or I could help more.

I don't know of any way for a GDL object to pick up the names of objects in a directory.
Tom Waltz
Frank Beister
Moderator
Toms idea is quiet well.

After PARAMETERS you can list all values, which should be set by the main object.

After RETURNED_PARAMETERS you can add a list of variables of the main object, which will be filled after execution of the macro object by the values after END (of the macro-object!). Watch the order of variable names and values.

You can call the macros as many times as you want. You can let them do different things depending of the context you call them. You can check this in the macro by GLOB_SCRIPT_TYPE and GLOB_CONTEXT. So if you call from master-script you could return just the values. If you call from 3D-script you could just "built" the baluster.

There is a GDL-AddOn "GDL File Manager In-Out" to read file- and directory-names. But you have to open it by an existing pathname. AFAIK is there no way to request the actual path of an active library.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm