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

layoutinfo. customData give me bundles of guid - >value but where do I get a bundle of varname->guid

Tsepov
Newcomer
User was create new variable in master layout.
I need to get value of that variable by name.
But I have only pairs guid->value in the layout.customData.
How I can get values by variable name?
In original example Database_Control.cpp there is a no informative code how to change all variables:

//---->>>
API_LayoutInfo	layoutInfo;
BNZeroMemory (&layoutInfo, sizeof (API_LayoutInfo));
if (ACAPI_Environment (APIEnv_GetLayoutSetsID, &layoutInfo, &api_dbPars.databaseUnId) == NoError) 
{
	...
      for (auto it = layoutInfo.customData->EnumeratePairs (); it != nullptr; ++it) 
      {
                   *it->value += " - Modified via API";
       }
      ACAPI_Environment (APIEnv_ChangeLayoutSetsID, &layoutInfo, &api_dbPars.databaseUnId);
}
//<<<----
My code is:
//->>
API_LayoutInfo layoutInfo;
err = ACAPI_Environment(APIEnv_GetLayoutSetsID, &layoutInfo, &databaseUnId, &actualPageIndex);
if (layoutInfo.customData != nullptr)
{
       if (layoutInfo.customData->GetSize() > 0)
       {
             Guid keyguid;
             keyguid.ConvertFromString("7151E155-1B9B-4F17-9D4F-35F8036DE4A2");
             API_Guid key = GSGuid2APIGuid(keyguid);//layoutInfo.customData->GetAKey(0);
             UniString us;
	     if(layoutInfo.customData->ContainsKey(key))
                   us = layoutInfo.customData->Get(key);
	}
}

As result - us contains value.
But I need to get it by layout custom variable name;
ARCHICAD - The Best!!!
1 ACCEPTED SOLUTION

Solution
Oleg
Enthusiast
I didnt try, but I guess you need function:

GSErrCode ACAPI_Database ( APIDb_GetLayoutBookID, API_LayoutBook* book );

and field

book->customScheme

View solution in original post

2 REPLIES 2

Solution
Oleg
Enthusiast
I didnt try, but I guess you need function:

GSErrCode ACAPI_Database ( APIDb_GetLayoutBookID, API_LayoutBook* book );

and field

book->customScheme

View solution in original post

Tsepov
Newcomer
It works great!
Thank you very much!
ARCHICAD - The Best!!!

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!