<?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: Append items to a Library (GDL) array parameter from a C++ addon in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Append-items-to-a-Library-GDL-array-parameter-from-a-C-addon/m-p/341659#M8559</link>
    <description>&lt;P&gt;Alright, in the section about&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType&lt;/A&gt;&amp;nbsp; under remarks, it says:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For parameters with array modifier, you can change the dimensions of the array on the fly when you create or modify an element.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Do they mean that i can change dim1 and dim2 in&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType&lt;/A&gt;&amp;nbsp; to&amp;nbsp;the desired size and then set the item? But I interpret the docs as modyfing&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType&lt;/A&gt;&amp;nbsp;directly is an incorrect approach:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If you manipulate the&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_blank" rel="noopener"&gt;API_AddParType&lt;/A&gt;&amp;nbsp;handle directly, the parameter list may become invalid.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;AND&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;It is strongly advised to use the&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_openparametersid" target="_blank" rel="noopener"&gt;APIAny_OpenParametersID&lt;/A&gt;,&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_changeaparameterid" target="_blank" rel="noopener"&gt;APIAny_ChangeAParameterID&lt;/A&gt;,&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_getactparametersid" target="_blank" rel="noopener"&gt;APIAny_GetActParametersID&lt;/A&gt;,&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_closeparametersid" target="_blank" rel="noopener"&gt;APIAny_CloseParametersID&lt;/A&gt;&amp;nbsp;functions to modify a parameter in the parameter list.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what is the recommended approach to appending items / resizing a GDL array from C++ then? I am getting a feeling from the docs that &lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType&lt;/A&gt;&amp;nbsp;should not be modified directly.&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jun 2022 15:05:50 GMT</pubDate>
    <dc:creator>BenjiDev</dc:creator>
    <dc:date>2022-06-18T15:05:50Z</dc:date>
    <item>
      <title>Append items to a Library (GDL) array parameter from a C++ addon</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Append-items-to-a-Library-GDL-array-parameter-from-a-C-addon/m-p/341654#M8558</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can successfully modify items in an array parameter of a Library (GDL) object using the approach described here &lt;SPAN&gt;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_openparametersid" target="_self"&gt;APIAny_​OpenParametersID&lt;/A&gt;&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;Since&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_changeparamtype" target="_self"&gt;API_​ChangeParamType&lt;/A&gt;&amp;nbsp;takes an "ind1" and "ind2" its quite straightforward to do so.&lt;/P&gt;
&lt;P&gt;Now how do i go about appending items to the array, or maybe completely replace the array with new values? If ind1 or ind2 is out of bounds i will get an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to&amp;nbsp;&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;For parameters with array modifier, you can change the dimensions of the array on the fly when you create or modify an element. This enables you to put just a placeholder for an array into the library part parameter, and adjust that when you actually place the library part.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this mean you can change dim1 and dim2 in the&amp;nbsp;&amp;nbsp;API_​AddParType struct directly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But at the same time it is &lt;SPAN&gt;discouraged to modify&amp;nbsp;API_​AddParType (taken from &lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_openparametersid" target="_self"&gt;APIAny_​OpenParametersID)&lt;/A&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The only way to ensure full parameter consistency while changing a value of a Library Part parameter is to use the functions provided for this operation. If you manipulate the&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_blank" rel="noopener"&gt;API_AddParType&lt;/A&gt;&amp;nbsp;handle directly, the parameter list may become invalid.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and from&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;It is strongly advised to use the&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_openparametersid" target="_blank" rel="noopener"&gt;APIAny_OpenParametersID&lt;/A&gt;,&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_changeaparameterid" target="_blank" rel="noopener"&gt;APIAny_ChangeAParameterID&lt;/A&gt;,&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_getactparametersid" target="_blank" rel="noopener"&gt;APIAny_GetActParametersID&lt;/A&gt;,&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_closeparametersid" target="_blank" rel="noopener"&gt;APIAny_CloseParametersID&lt;/A&gt;&amp;nbsp;functions to modify a parameter in the parameter list.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the recommended/safe/standard way to append items / resize a GDL array parameter from the C++ side then?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 10:57:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Append-items-to-a-Library-GDL-array-parameter-from-a-C-addon/m-p/341654#M8558</guid>
      <dc:creator>BenjiDev</dc:creator>
      <dc:date>2024-09-17T10:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Append items to a Library (GDL) array parameter from a C++ addon</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Append-items-to-a-Library-GDL-array-parameter-from-a-C-addon/m-p/341659#M8559</link>
      <description>&lt;P&gt;Alright, in the section about&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType&lt;/A&gt;&amp;nbsp; under remarks, it says:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For parameters with array modifier, you can change the dimensions of the array on the fly when you create or modify an element.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Do they mean that i can change dim1 and dim2 in&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType&lt;/A&gt;&amp;nbsp; to&amp;nbsp;the desired size and then set the item? But I interpret the docs as modyfing&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType&lt;/A&gt;&amp;nbsp;directly is an incorrect approach:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If you manipulate the&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_blank" rel="noopener"&gt;API_AddParType&lt;/A&gt;&amp;nbsp;handle directly, the parameter list may become invalid.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;AND&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;It is strongly advised to use the&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_openparametersid" target="_blank" rel="noopener"&gt;APIAny_OpenParametersID&lt;/A&gt;,&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_changeaparameterid" target="_blank" rel="noopener"&gt;APIAny_ChangeAParameterID&lt;/A&gt;,&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_getactparametersid" target="_blank" rel="noopener"&gt;APIAny_GetActParametersID&lt;/A&gt;,&amp;nbsp;&lt;A href="https://archicadapi.Graphisoft.com/documentation/apiany_closeparametersid" target="_blank" rel="noopener"&gt;APIAny_CloseParametersID&lt;/A&gt;&amp;nbsp;functions to modify a parameter in the parameter list.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what is the recommended approach to appending items / resizing a GDL array from C++ then? I am getting a feeling from the docs that &lt;A href="https://archicadapi.Graphisoft.com/documentation/api_addpartype" target="_self"&gt;API_​AddParType&lt;/A&gt;&amp;nbsp;should not be modified directly.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jun 2022 15:05:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Append-items-to-a-Library-GDL-array-parameter-from-a-C-addon/m-p/341659#M8559</guid>
      <dc:creator>BenjiDev</dc:creator>
      <dc:date>2022-06-18T15:05:50Z</dc:date>
    </item>
  </channel>
</rss>

