We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Navigator Items especially Layouts

Anonymous
Not applicable
Hi there!

I tried to get navigator items in the navigator. I use AC20 so I'm using ACAPI_Environment calls.

The provided example of getting Views is working fine I can get the array of nav. items.
item.itemType = API_StoryNavItem;
item.mapId    = API_PublicViewMap;

err = ACAPI_Environment (APIEnv_SearchNavigatorItemID, &item, &items, NULL);
But i tried to change parameters to get layouts like below, and i'm getting this error:
APIERR_BADDATABASE	-2130313110	
.
item.itemType = API_LayoutNavItem;
item.mapId    = API_LayoutMap;

err = ACAPI_Environment (APIEnv_SearchNavigatorItemID, &item, &items, NULL);
From that error i tried to assign database info to the search query. with this.
API_DatabaseInfo db;
BNZeroMemory (&db, sizeof (API_DatabaseInfo));
db.typeID = APIWind_LayoutID;

item.itemType = API_LayoutNavItem;
item.mapId    = API_LayoutMap;
item.db		  =db;

err = ACAPI_Environment (APIEnv_SearchNavigatorItemID, &item, &items, NULL);
And this way i got the same result... database error.

So i tried to change the database before the query by:
err=ACAPI_Database (APIDb_ChangeCurrentDatabaseID,&db);
And this gave me the same database error. After that i don't have aní clue to solve my issue.

My main goal is that, to create an addon which publish every layout with different graphical overrides, so the background color of the active( printed) room is different then other rooms.

My plan was to do that is this: Loop through layouts, change graphical overrides, to meet the requirements, plot the layout, change back the original override, and then go to next.

So if you think that i'm on the wrong pat to solve this problem, then tell me. And of course if you have some idea what's wrong currently with this code, i'd be glad.
10 REPLIES 10
Anonymous
Not applicable
Yep it’s great. Found the problem - My mask lines was out of the for loop for each drawing. THANKS!