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

Getting material of a polygon, Component3D[solved]

Anonymous
Not applicable
Hi

I have some problems getting the material of polygons right, here is how I do it(short version without any error handling):

...
attrib.header.typeID = API_MaterialID;
for(j = 1; j <= nPolygons; j++)
{
  component.header.typeID = API_PgonID;
  component.header.index = j;
  ACAPI_3D_GetComponent(&component);
  attrib.material.head.index = component.pgon.iumat;
  ACAPI_Attribute_Get (&attrib);
  Print(attrib.material.head.name);//prints wrong material name...
}
...
Can you spot where the problem is?

//Jesper
1 REPLY 1
Anonymous
Not applicable