<?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: Looping through GS::Array&amp;lt;API_Guid&amp;gt; in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223640#M2241</link>
    <description>&lt;BLOCKQUOTE&gt;poco2013 wrote:&lt;BR /&gt;They are essentially the same thing except GS::Guid is packed as a Class and API_Guid is a structure.&lt;BR /&gt;
&lt;BR /&gt;
From the API Manual:&lt;BR /&gt;
&lt;BR /&gt;
    "API_Guid is essentially a GS::Guid. It has the same size and structure, and only exists because of certain C++ language limitations: namely that a union (like API_Element) cannot contain a class which has a constructor or destructor. Since API_Elem_Head needs to contain a Guid member, and it cannot be a GS::Guid, the API_Guid structure was introduced."&lt;/BLOCKQUOTE&gt;

Thanks a lot Gerry!</description>
    <pubDate>Mon, 23 Aug 2021 06:15:50 GMT</pubDate>
    <dc:creator>dushyant</dc:creator>
    <dc:date>2021-08-23T06:15:50Z</dc:date>
    <item>
      <title>Looping through GS::Array&lt;API_Guid&gt;</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223633#M2234</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi&lt;BR /&gt;&lt;BR /&gt;How can I loop through the items stored in a GS::Array&amp;lt;API_Guid&amp;gt; array? I want to print all the Guids stored in it, say via ACAPI_WriteReport().. &lt;BR /&gt;(Also, how do you normally print out data to check values while developing/debugging?)&lt;BR /&gt;&lt;BR /&gt;I tried: for (int i = 0; i &amp;lt; sizeof(arrayName); i++) { .. } but it is giving out some strange results.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:20:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223633#M2234</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-09-14T07:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through GS::Array&lt;API_Guid&gt;</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223634#M2235</link>
      <description>You can use it like an std::vector.&lt;BR /&gt;
&lt;BR /&gt;
For example:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;for (UIndex i = 0; i &amp;lt; array.GetSize (); i++) {
    const API_Guid&amp;amp; guid = array&lt;I&gt;;
    // do something with the guid
}
&lt;/I&gt;&lt;/PRE&gt;

or&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;for (const API_Guid&amp;amp; guid : array) {
    // do something with the guid
}
&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Aug 2021 12:57:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223634#M2235</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2021-08-20T12:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through GS::Array&lt;API_Guid&gt;</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223635#M2236</link>
      <description>Hi, try: 
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;GS::Array&amp;lt;API_Guid&amp;gt; array;
    for(auto element : elemList)
    {...}
&lt;/PRE&gt;
or 
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;    for (GS::Array&amp;lt;API_Guid&amp;gt;::ConstIterator element = array.Enumerate(); element  != nullptr; ++element )
    {...}
&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Aug 2021 12:58:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223635#M2236</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-20T12:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through GS::Array&lt;API_Guid&gt;</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223636#M2237</link>
      <description>Thanks Viktor and Konstantin.&lt;BR /&gt;
&lt;BR /&gt;
I am trying to print the Guids using ACAPI_WriteReport()  , as I don't know of any other way to print debug info in Archicad, using the "%s" format specifier, like this:&lt;BR /&gt;

&lt;PRE&gt;for (const API_Guid&amp;amp; guid : arrayOfGuids) {
      ACAPI_WriteReport("%s", false, guid);
}&lt;/PRE&gt;

It is not printing anything. How to print an API_Guid ?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Fri, 20 Aug 2021 13:30:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223636#M2237</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-08-20T13:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through GS::Array&lt;API_Guid&gt;</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223637#M2238</link>
      <description>This will work but is not the optimum way. Someone else may input the proper utility but this is what I use.&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;char hold[254] = {};
APIGuid2GSGuid(guid).ConvertToString(hold)
ACAPI_WriteReport("%s",false,hold);
&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Aug 2021 22:18:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223637#M2238</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2021-08-20T22:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through GS::Array&lt;API_Guid&gt;</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223638#M2239</link>
      <description>&lt;BLOCKQUOTE&gt;poco2013 wrote:&lt;BR /&gt;
This will work but is not the optimum way. Someone else may input the proper utility but this is what I use.&lt;BR /&gt;
Code: Select all&lt;BR /&gt;
&lt;BR /&gt;
char hold[254] = {};&lt;BR /&gt;
APIGuid2GSGuid(guid).ConvertToString(hold)&lt;BR /&gt;
ACAPI_WriteReport("%s",false,hold);
&lt;/BLOCKQUOTE&gt;

Thanks Gerry, that worked perfectly.&lt;BR /&gt;
&lt;BR /&gt;
So API-Guid and GS-Guid are different?</description>
      <pubDate>Sat, 21 Aug 2021 09:04:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223638#M2239</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-08-21T09:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through GS::Array&lt;API_Guid&gt;</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223639#M2240</link>
      <description>&lt;BLOCKQUOTE&gt;dushyant wrote:&lt;BR /&gt;
&lt;BR /&gt;
So API-Guid and GS-Guid are different?
&lt;/BLOCKQUOTE&gt;

They are  essentially the same thing except GS::Guid is packed as a Class and API_Guid is a structure.&lt;BR /&gt;
&lt;BR /&gt;
From the API Manual:&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;"API_Guid is essentially a GS::Guid. It has the same size and structure, and only exists because of certain C++ language limitations: namely that a union (like API_Element) cannot contain a class which has a constructor or destructor. Since API_Elem_Head needs to contain a Guid member, and it cannot be a GS::Guid, the API_Guid structure was introduced."&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sat, 21 Aug 2021 09:27:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223639#M2240</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2021-08-21T09:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through GS::Array&lt;API_Guid&gt;</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223640#M2241</link>
      <description>&lt;BLOCKQUOTE&gt;poco2013 wrote:&lt;BR /&gt;They are essentially the same thing except GS::Guid is packed as a Class and API_Guid is a structure.&lt;BR /&gt;
&lt;BR /&gt;
From the API Manual:&lt;BR /&gt;
&lt;BR /&gt;
    "API_Guid is essentially a GS::Guid. It has the same size and structure, and only exists because of certain C++ language limitations: namely that a union (like API_Element) cannot contain a class which has a constructor or destructor. Since API_Elem_Head needs to contain a Guid member, and it cannot be a GS::Guid, the API_Guid structure was introduced."&lt;/BLOCKQUOTE&gt;

Thanks a lot Gerry!</description>
      <pubDate>Mon, 23 Aug 2021 06:15:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Looping-through-GS-Array-lt-API-Guid-gt/m-p/223640#M2241</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-08-23T06:15:50Z</dc:date>
    </item>
  </channel>
</rss>

