<?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: attrib.header.index = i; is error. in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/attrib-header-index-i-is-error/m-p/580098#M8988</link>
    <description>&lt;P&gt;What version of Archcade are you using? In version 27, the implementation of API_AttributeIndex has changed.&lt;/P&gt;
&lt;P&gt;Try attrib.header.index = ACAPI_CreateAttributeIndex (i);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://graphisoft.github.io/archicad-api-devkit/class_a_p_i___attribute_index.html" target="_blank"&gt;https://graphisoft.github.io/archicad-api-devkit/class_a_p_i___attribute_index.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Dec 2023 08:25:09 GMT</pubDate>
    <dc:creator>kuvbur</dc:creator>
    <dc:date>2023-12-13T08:25:09Z</dc:date>
    <item>
      <title>attrib.header.index = i; is error.</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/attrib-header-index-i-is-error/m-p/580076#M8987</link>
      <description>&lt;P&gt;I'm studying the previous code, but I can't put a constant in the index. What should I do?&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="LeeJaeYoung_0-1702444725165.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/50427i3987B2163C2F3451/image-size/large?v=v2&amp;amp;px=999" role="button" title="LeeJaeYoung_0-1702444725165.png" alt="LeeJaeYoung_0-1702444725165.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;for (UInt32 i = 2; i &amp;lt;= count; i++) //I starts from 2 because 1 is Archicad layer
{
BNZeroMemory(&amp;amp;attrib, sizeof(API_Attribute));
attrib.header.typeID = API_LayerID;
attrib.header.index = i;
err = ACAPI_Attribute_Get(&amp;amp;attrib);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&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="LeeJaeYoung_2-1702444840055.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/50429i620DD5ED3605FF36/image-size/large?v=v2&amp;amp;px=999" role="button" title="LeeJaeYoung_2-1702444840055.png" alt="LeeJaeYoung_2-1702444840055.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/API-hide-all-layers/m-p/152862" target="_blank" rel="noopener"&gt;API hide all layers - Graphisoft Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q2.&amp;nbsp;Looking at this code, it seems strange.&lt;BR /&gt;Count and index are not the same thing, but it looks as if the index is set in count order.&lt;BR /&gt;I don't think you can do full Hidden with this code.&lt;BR /&gt;Is full Hidden possible?&lt;BR /&gt;Where can I study?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;err = ACAPI_Attribute_GetNum(API_LayerID, count);
if (err) {
WriteReport_Err("ACAPI_Attribute_GetNum", err);
return;
}

ACAPI_WriteReport("name: = %d", true, count);

for (UInt32 i = 2; i &amp;lt;= count; i++) //I starts from 2 because 1 is Archicad layer
{
BNZeroMemory(&amp;amp;attrib, sizeof(API_Attribute));
attrib.header.typeID = API_LayerID;
attrib.header.index = i;
err = ACAPI_Attribute_Get(&amp;amp;attrib);

if (!err &amp;amp;&amp;amp; attrib.layer.head.flags != APILay_Hidden)
{
attrib.layer.head.flags |= APILay_Hidden; // you should add ‘|’ because flags has another bit of information (APILay_Locked)

err = ACAPI_Attribute_Modify(&amp;amp;attrib, nullptr);
if (err != NoError) {
WriteReport_Err("Unable to modify the layer", err);
return;
}
}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Sep 2024 11:18:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/attrib-header-index-i-is-error/m-p/580076#M8987</guid>
      <dc:creator>LeeJaeYoung</dc:creator>
      <dc:date>2024-09-17T11:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: attrib.header.index = i; is error.</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/attrib-header-index-i-is-error/m-p/580098#M8988</link>
      <description>&lt;P&gt;What version of Archcade are you using? In version 27, the implementation of API_AttributeIndex has changed.&lt;/P&gt;
&lt;P&gt;Try attrib.header.index = ACAPI_CreateAttributeIndex (i);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://graphisoft.github.io/archicad-api-devkit/class_a_p_i___attribute_index.html" target="_blank"&gt;https://graphisoft.github.io/archicad-api-devkit/class_a_p_i___attribute_index.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 08:25:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/attrib-header-index-i-is-error/m-p/580098#M8988</guid>
      <dc:creator>kuvbur</dc:creator>
      <dc:date>2023-12-13T08:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: attrib.header.index = i; is error.</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/attrib-header-index-i-is-error/m-p/580104#M8990</link>
      <description>&lt;P&gt;All layers are not turned off like in q2.&lt;BR /&gt;What do I need to study to learn the code to turn off an entire layer?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you ^^&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="LeeJaeYoung_0-1702457096695.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/50438i01BF673B1A5C9B84/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeeJaeYoung_0-1702457096695.png" alt="LeeJaeYoung_0-1702457096695.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeeJaeYoung_1-1702457109758.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/50439iE83BEF12738DD8AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeeJaeYoung_1-1702457109758.png" alt="LeeJaeYoung_1-1702457109758.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 08:45:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/attrib-header-index-i-is-error/m-p/580104#M8990</guid>
      <dc:creator>LeeJaeYoung</dc:creator>
      <dc:date>2023-12-13T08:45:24Z</dc:date>
    </item>
  </channel>
</rss>

