<?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: Retrieve and update the surface color override in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Retrieve-and-update-the-surface-color-override/m-p/575462#M8890</link>
    <description>&lt;P&gt;Viktor, you have provided an accurate solution, thank you so much!&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2023 15:49:10 GMT</pubDate>
    <dc:creator>allen-bohm</dc:creator>
    <dc:date>2023-11-14T15:49:10Z</dc:date>
    <item>
      <title>Retrieve and update the surface color override</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Retrieve-and-update-the-surface-color-override/m-p/574978#M8852</link>
      <description>&lt;P&gt;Hello, could you please help to advise what API I could use to retrieve and update the surface colour&amp;nbsp;override for an element?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SCR-20231110-kftg.png" style="width: 632px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/48836iB90C1AE2A819387F/image-dimensions/632x450?v=v2" width="632" height="450" role="button" title="SCR-20231110-kftg.png" alt="SCR-20231110-kftg.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 11:20:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Retrieve-and-update-the-surface-color-override/m-p/574978#M8852</guid>
      <dc:creator>allen-bohm</dc:creator>
      <dc:date>2024-09-17T11:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve and update the surface color override</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Retrieve-and-update-the-surface-color-override/m-p/575422#M8888</link>
      <description>&lt;P&gt;This is an element-specific parameter so the way to change the override is dependent on the element type. Let's say you have a guid for an element (for example by enumerating selected elements) and the index of the new Surface (called Material on the API). This code will do the trick for Walls and GDL objects. The other elements work in a very similar way.&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;API_Element element = {};
element.header.guid = elementGuid;
ACAPI_Element_Get (&amp;amp;element);

API_AttributeIndex newMaterialIndex = ACAPI_CreateAttributeIndex (15);

API_Element mask = {};
ACAPI_ELEMENT_MASK_CLEAR (mask);
switch (element.header.type.typeID) {
    case API_WallID:
        element.wall.refMat = newMaterialIndex;
        element.wall.oppMat = newMaterialIndex;
        element.wall.sidMat = newMaterialIndex;
        ACAPI_ELEMENT_MASK_SET (mask, API_WallType, refMat);
        ACAPI_ELEMENT_MASK_SET (mask, API_WallType, oppMat);
        ACAPI_ELEMENT_MASK_SET (mask, API_WallType, sidMat);
        break;
    case API_ObjectID:
        element.object.mat = newMaterialIndex;
        element.object.useObjMaterials = false;
        ACAPI_ELEMENT_MASK_SET (mask, API_ObjectType, mat);
        ACAPI_ELEMENT_MASK_SET (mask, API_ObjectType, useObjMaterials);
        break;
}

ACAPI_Element_Change (&amp;amp;element, &amp;amp;mask, nullptr, 0, true);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 11:36:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Retrieve-and-update-the-surface-color-override/m-p/575422#M8888</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2023-11-14T11:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve and update the surface color override</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Retrieve-and-update-the-surface-color-override/m-p/575462#M8890</link>
      <description>&lt;P&gt;Viktor, you have provided an accurate solution, thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 15:49:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Retrieve-and-update-the-surface-color-override/m-p/575462#M8890</guid>
      <dc:creator>allen-bohm</dc:creator>
      <dc:date>2023-11-14T15:49:10Z</dc:date>
    </item>
  </channel>
</rss>

