<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [newbie] browsing through materials in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63005#M7714</link>
    <description>And now the Radiance image (note that textures are ignored, but Sun Position, Camera Viewpoint and View Angle is fine).&lt;BR /&gt;
&lt;BR /&gt;
The floor was using "Wood-Pine Shiny" and the rest is "Surface-Whitewash". In the export they are both wrong and turn to&lt;BR /&gt;
"Brick Face" and "Surface Plaster Rough".&lt;BR /&gt;
I don't think it's a coincidence that the last two materials have been the first two in the complete list of materials, which I generated as follows (based on the API-examples):
&lt;PRE&gt;API_Attribute		attrib;
BNZeroMemory (&amp;amp;attrib, sizeof (API_Attribute));
err = ACAPI_Attribute_GetNum (API_MaterialID, &amp;amp;nAttr);
for (short i = 1; i &amp;lt;= nAttr &amp;amp;&amp;amp; err == NoError; i++)
{
	attrib.header.typeID = API_MaterialID;
	attrib.header.index = i;
	err = ACAPI_Attribute_Get (&amp;amp;attrib);
	if (err == NoError)
	{
		char nameBuffer[64];
		sprintf(nameBuffer, "'%s'", attrib.header.name);
	}
}&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Jun 2004 09:36:40 GMT</pubDate>
    <dc:creator>stefan</dc:creator>
    <dc:date>2004-06-01T09:36:40Z</dc:date>
    <item>
      <title>[newbie] browsing through materials</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63004#M7713</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;When I step through all the materials, one at a time, I can get all info from them. However, when I step through the geometry from the 3D-Window, I get some "iumat" short that should be an index into the materials.&lt;BR /&gt;&lt;BR /&gt;When I use this "iumat" I can reach materials, but not the ones I was expecting:
&lt;PRE&gt;material  =	component.pgon.iumat;
API_Attribute    attrib;
BNZeroMemory (&amp;amp;attrib, sizeof (API_Attribute));
attrib.header.typeID = API_MaterialID;
attrib.header.index = material;
err = ACAPI_Attribute_Get (&amp;amp;attrib);
if (err == NoError)
{
	sprintf(matBuffer, "%s",  attrib.header.name);
}&lt;/PRE&gt;
&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/70845i77DE837FB14DE78B/image-size/large?v=v2&amp;amp;px=999" border="0" alt="archicad.jpg" title="archicad.jpg" /&gt;</description>
      <pubDate>Mon, 07 Aug 2023 10:22:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63004#M7713</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2023-08-07T10:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] browsing through materials</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63005#M7714</link>
      <description>And now the Radiance image (note that textures are ignored, but Sun Position, Camera Viewpoint and View Angle is fine).&lt;BR /&gt;
&lt;BR /&gt;
The floor was using "Wood-Pine Shiny" and the rest is "Surface-Whitewash". In the export they are both wrong and turn to&lt;BR /&gt;
"Brick Face" and "Surface Plaster Rough".&lt;BR /&gt;
I don't think it's a coincidence that the last two materials have been the first two in the complete list of materials, which I generated as follows (based on the API-examples):
&lt;PRE&gt;API_Attribute		attrib;
BNZeroMemory (&amp;amp;attrib, sizeof (API_Attribute));
err = ACAPI_Attribute_GetNum (API_MaterialID, &amp;amp;nAttr);
for (short i = 1; i &amp;lt;= nAttr &amp;amp;&amp;amp; err == NoError; i++)
{
	attrib.header.typeID = API_MaterialID;
	attrib.header.index = i;
	err = ACAPI_Attribute_Get (&amp;amp;attrib);
	if (err == NoError)
	{
		char nameBuffer[64];
		sprintf(nameBuffer, "'%s'", attrib.header.name);
	}
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Jun 2004 09:36:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63005#M7714</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-01T09:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] browsing through materials</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63006#M7715</link>
      <description>&lt;BLOCKQUOTE&gt;stefan wrote:&lt;BR /&gt;When I step through all the materials, one at a time, I can get all info from them. However, when I step through the geometry from the 3D-Window, I get some "iumat" short that should be an index into the materials.
&lt;/BLOCKQUOTE&gt;

I did not try, but I think iumat isnot material attribute index, it is API_UmatType components index of API_Component3D.</description>
      <pubDate>Tue, 01 Jun 2004 10:51:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63006#M7715</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2004-06-01T10:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] browsing through materials</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63007#M7716</link>
      <description>And again a big thank you!&lt;BR /&gt;

&lt;PRE&gt;char matBuffer[64];
material = component.pgon.iumat;
API_Component3D component3D;
component3D.header.typeID = API_UmatID;
component3D.header.index = material;
err = ACAPI_3D_GetComponent(&amp;amp;component3D);
if (err == NoError)
{
	API_UmatType umatType = component3D.umat;
	sprintf(matBuffer, "%s",  umatType.mater.head.name);
}&lt;/PRE&gt;
Now I get the correct material from a 3D Polygon...&lt;BR /&gt;
It seems the the "Attribute" Material and the "3DComponent" Material are reached in a complete different way!&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/7661i1257F70B65EECB7C/image-size/large?v=v2&amp;amp;px=999" border="0" alt="rview2.jpg" title="rview2.jpg" /&gt;</description>
      <pubDate>Tue, 01 Jun 2004 12:07:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63007#M7716</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-01T12:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] browsing through materials</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63008#M7717</link>
      <description>&lt;BLOCKQUOTE&gt;stefan wrote:&lt;BR /&gt;It seems the the "Attribute" Material and the "3DComponent" Material are reached in a complete different way!&lt;/BLOCKQUOTE&gt;

I can only assume about the reason. Materials for polugons can be defined inside GDL script or binary section of object. They will not have the appropriate material attributes. Probably therefore there is this umat components. &lt;BR /&gt;
&lt;BR /&gt;
PS: By the way, I am not sure, but it is possible that names of Umat materials are not unique and can be duplicated, if some objects will have various definitions of materials with an identical name. Though I did not try.</description>
      <pubDate>Tue, 01 Jun 2004 13:01:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-browsing-through-materials/m-p/63008#M7717</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2004-06-01T13:01:20Z</dc:date>
    </item>
  </channel>
</rss>

