cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Streamline your workflows and master BIM coordination! Program starts April 28!

Archicad C++ API
About Archicad add-on development using the C++ API.

Exceptions calling GetUserId and GetOrganizationIds functions

Fermat
Contributor

I made some tests with GSID functions to get user ID and organization IDs but there are some issues.

This is the code:

 

GS::UniString userStr;
GS::UniString orgsStr;

auto gsid = ACAPI::CreateGSIDObject();
if (!gsid.IsErr())
{
    auto userId = gsid->GetUserId();
    if (userId.IsOk())
    userStr = *userId;

    auto userOrgs = gsid->GetOrganizationIds();
    if (userOrgs.IsOk())
    {
       for (const auto& userOrg : *userOrgs)
       {
          orgsStr += userOrg + ", ";
       }
    }
}


I tried this code on Windows in Archicad 27 and 28 with same behavior.

If there is no logged user in Archicad there is an exception when class
destructor of "userId" is called at the end.

 

If there is a logged user in Archicad instead userId is OK, but the line
"for (const auto& userOrg : *userOrgs)" raises an exception.

 

Thanks in advice

0 REPLIES 0

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!