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

Getting the index of inline defined material.

Nader Belal
Mentor
Hi everyone,

I have an object that have an inline defines material.

But it happens that I need the index of that inline defined material so that I can use it with tube{2} command, since that when that material name was called (either by scripting it's name or by the a ind(material, inline_defined_material) ) didn't work, but with other loaded material it worked just fine.

How should I proceed ?
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.
9 REPLIES 9
Jochen Suehlo
Moderator
Since the material index is managed only project-wide, a locally defined material also does not receive an index. It can then only be set with its plain text. The IND () function does not provide any material.
With IND (), only materials that are globally available and therefore have an internal index can be queried. Locally defined materials provide the index -1, so not available.
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Nader Belal
Mentor
Ok, so how can I use inline defined material in tube{2}?
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.
(Probably) yes,

Fun fact is that the inability of using inline materials comes from inability of recognizing the negative index values...yes the inline defined attributes get negative indexes.

Piotr
Nader Belal
Mentor
@Piotr

Well I tried two ways, first by putting the name of the inline material name and the second by trying to get it's index using IND().

Both have failed.

The third way didn't produce an error code, but it became transparent.

So how can I use inline defined material in tube{2} command ??
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.
Jochen Suehlo
Moderator
I am not shure, but I think, it is not possible for alle GDL commands with materials in their syntax.
Please ask the Grapfisoft GDL experts in the forum on gdl.graphisoft.com
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Nader Belal
Mentor
Thank you Joachim
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.
Easy way to check if the command works with inline materials is to place in the edge material the index -2...
(of material).
Of course You have to have at least 2 inline defined materials.
Why not -1: well it looks that even the commands not working with inline materials do actually work with -1 (the first defined inline)

So if Your object neeeds 1 (only one) inline defined material - it will probably work with all even the older commands.

Piotr
Nader Belal
Mentor
Thanks Piotr
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.
And for the reference: Tube{2} does not take the inline material defs.
waiting for {3} ....

Piotr