<?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 [SOLVED] Guid array in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Guid-array/m-p/256480#M5517</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;
&lt;PRE&gt;for (GS::Array&amp;lt;API_Guid&amp;gt;::ConstIterator it = elements.Enumerate (); it != NULL; ++it) {   
         BNZeroMemory (&amp;amp;element, sizeof (API_Element));   
         element.header.guid = *it; &lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;I have specified witch guid to get. And i need to store them in array. I guess i'm doing something wrong. &lt;BR /&gt;When i use like this, Archicad crashes.:
&lt;PRE&gt;API_Guid *arrayGuid  
arrayGuid&lt;I&gt;=*it;&lt;/I&gt;&lt;/PRE&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 01 Aug 2023 11:28:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-01T11:28:56Z</dc:date>
    <item>
      <title>[SOLVED] Guid array</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Guid-array/m-p/256480#M5517</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;
&lt;PRE&gt;for (GS::Array&amp;lt;API_Guid&amp;gt;::ConstIterator it = elements.Enumerate (); it != NULL; ++it) {   
         BNZeroMemory (&amp;amp;element, sizeof (API_Element));   
         element.header.guid = *it; &lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;I have specified witch guid to get. And i need to store them in array. I guess i'm doing something wrong. &lt;BR /&gt;When i use like this, Archicad crashes.:
&lt;PRE&gt;API_Guid *arrayGuid  
arrayGuid&lt;I&gt;=*it;&lt;/I&gt;&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:28:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Guid-array/m-p/256480#M5517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-01T11:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Guid array</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Guid-array/m-p/256481#M5518</link>
      <description>First you must allocate the memory for the array. There are several ways to do that, here is one for example:
&lt;PRE&gt;// allocate memory for the array:
API_Guid** arrayGuid = (API_Guid**) BMAllocateHandle (elements.GetSize () * sizeof (API_Guid), ALLOCATE_CLEAR, 0);

// using the array:
(*arrayGuid)&lt;I&gt; = (*it);

// when finished the work with the array don't forget to free the memory:
BMKillHandle ((GSHandle *) &amp;amp;arrayGuid);&lt;/I&gt;&lt;/PRE&gt;
Or if you don't want to bother with memory handling, then you should use GS::Array for this purpose:
&lt;PRE&gt;GS::Array&amp;lt;API_Guid&amp;gt; arrayGuid;
arrayGuid.Push (*it);
// or insert it to a specific index:
arrayGuid.Insert (i, *it);

// you can get the pointer to the array content also:
API_Guid* arrayGuidPointer = arrayGuid.GetContent ();
arrayGuidPointer&lt;I&gt; = (*it);&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2015 08:51:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Guid-array/m-p/256481#M5518</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2015-03-26T08:51:24Z</dc:date>
    </item>
  </channel>
</rss>

