<?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 Exceptions calling GetUserId and GetOrganizationIds functions in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/659434#M10271</link>
    <description>&lt;P&gt;I made some tests with GSID functions to get user ID and organization IDs but there are some issues.&lt;/P&gt;
&lt;P&gt;This is the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;GS::UniString userStr;
GS::UniString orgsStr;

auto gsid = ACAPI::CreateGSIDObject();
if (!gsid.IsErr())
{
    auto userId = gsid-&amp;gt;GetUserId();
    if (userId.IsOk())
    userStr = *userId;

    auto userOrgs = gsid-&amp;gt;GetOrganizationIds();
    if (userOrgs.IsOk())
    {
       for (const auto&amp;amp; userOrg : *userOrgs)
       {
          orgsStr += userOrg + ", ";
       }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;I tried this code on Windows in Archicad 27 and 28 with same behavior.&lt;/P&gt;
&lt;P&gt;If there is no logged user in Archicad there is an exception when class&lt;BR /&gt;destructor of "userId" is called at the end.&lt;/P&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;If there is a logged user in Archicad instead userId is OK, but the line&lt;BR /&gt;"for (const auto&amp;amp; userOrg : *userOrgs)" raises an exception.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advice&lt;/P&gt;</description>
    <pubDate>Mon, 21 Apr 2025 15:18:51 GMT</pubDate>
    <dc:creator>Fermat</dc:creator>
    <dc:date>2025-04-21T15:18:51Z</dc:date>
    <item>
      <title>Exceptions calling GetUserId and GetOrganizationIds functions</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/659434#M10271</link>
      <description>&lt;P&gt;I made some tests with GSID functions to get user ID and organization IDs but there are some issues.&lt;/P&gt;
&lt;P&gt;This is the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;GS::UniString userStr;
GS::UniString orgsStr;

auto gsid = ACAPI::CreateGSIDObject();
if (!gsid.IsErr())
{
    auto userId = gsid-&amp;gt;GetUserId();
    if (userId.IsOk())
    userStr = *userId;

    auto userOrgs = gsid-&amp;gt;GetOrganizationIds();
    if (userOrgs.IsOk())
    {
       for (const auto&amp;amp; userOrg : *userOrgs)
       {
          orgsStr += userOrg + ", ";
       }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;I tried this code on Windows in Archicad 27 and 28 with same behavior.&lt;/P&gt;
&lt;P&gt;If there is no logged user in Archicad there is an exception when class&lt;BR /&gt;destructor of "userId" is called at the end.&lt;/P&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;If there is a logged user in Archicad instead userId is OK, but the line&lt;BR /&gt;"for (const auto&amp;amp; userOrg : *userOrgs)" raises an exception.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advice&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 15:18:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/659434#M10271</guid>
      <dc:creator>Fermat</dc:creator>
      <dc:date>2025-04-21T15:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions calling GetUserId and GetOrganizationIds functions</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/661032#M10310</link>
      <description>&lt;P&gt;Does the same thing happen with both release and debug builds? And is this on macOS or Windows?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 13:16:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/661032#M10310</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2025-04-29T13:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions calling GetUserId and GetOrganizationIds functions</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/661135#M10315</link>
      <description>&lt;P&gt;The issue is only on Windows and happens with both debug and release versions.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 08:17:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/661135#M10315</guid>
      <dc:creator>Fermat</dc:creator>
      <dc:date>2025-04-30T08:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions calling GetUserId and GetOrganizationIds functions</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/661158#M10316</link>
      <description>&lt;P&gt;Is your release build linking against any debug libraries, e.g.&amp;nbsp;MSVCRTD.lib?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 11:38:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/661158#M10316</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2025-04-30T11:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions calling GetUserId and GetOrganizationIds functions</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/661162#M10317</link>
      <description>&lt;P&gt;No, no debug libraries linked in release version.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 11:57:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Exceptions-calling-GetUserId-and-GetOrganizationIds-functions/m-p/661162#M10317</guid>
      <dc:creator>Fermat</dc:creator>
      <dc:date>2025-04-30T11:57:38Z</dc:date>
    </item>
  </channel>
</rss>

