Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Material definitions calling from macro is - it possible

Hi,

I am preparing a library with quite a lot of material options - and I do not want do add them to the normal materials as they are strictly binded to the objects only - so master gdl file is out of the question.

I would like to make a call from the objects to the material definitions stored in separate file - and it looks like it is impossible without tricks.

For now I have to put the definitions to the mastrscript of every 3d macro unfortumately.
I have done that for another library by calling an outside texture list etc and compiling the material in the main file, but it is painfull as well...

So is there any way to call a macro that contains materials definitions?

Best Regards,
Piotr
6 REPLIES 6
Anonymous
Not applicable
I would guess the only way would be to return parameters and use those in a generic material definition.
So I did in some of my previous works...but this time I wanted to have the all materials defined, and would not work this way...

Anyway - it is wired that the value lists can be passed from macro - even without any parameters given nor returned, same for parts of UI script...but materials definitions - that do not use any parameters cannot be passed from macro to the main object.

Best Regards,
Piotr
Anonymous
Not applicable
It may not do what you are looking for but what I meant was not to define the materials in the macro but to assign the parameters (arrays or otherwise) that could be used in generic material definitions in the internal scripts of the calling macros.
Anonymous
Not applicable
Hello,

Put / Get can transfer data between the macro
and the caller object. Some example can be found
in the Finstone.lib where stone materials are defined
by a macro.

Hope this helps.
Thanks for the tips...

My original way of doing this was:

Main macro code:
if material_XXX="AAN" THEN 
	material_XXX_T = "AAN_antracyt.jpg"
	material_XXX_R=  38: material_XXX_G= 36: material_XXX_B= 37
ENDIF
So the list of textures and RGB values are in the main macro...to pass by returned parameters...


and in the calling file:

DEFINE TEXTURE "material_XXX_TT" material_XXX_T, 1, 1, 0, 0
DEFINE MATERIAL	material_XXX 20, [...]
I will check the tips...hope I will find better than above 😉


Best Regards,
Piotr
Jochen Suehlo
Moderator
Piotr, did you find a better way?
I think all the developers working on manufacturer objects have the same problem.

Graphisoft, do you have a better solution?
If not, it would be great for futurer GDL features that a kind of master_gdl file exists, that is a macro or does not write all the definitions into the ArchiCAD attributets.
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de