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

create layout [SOLVED]

ReignBough
Enthusiast
I am trying to create a new layout using ACAPI_Environment(APIEnv_NewNavigatorViewID). Here is my initial item data:
API_NavigatorItem navi_item;
BNZeroMemory(&navi_item, sizeof(API_NavigatorItem));
navi_item.mapId = API_LayoutMap;
navi_item.db.databaseUnId = a4_portrait.db.databaseUnId;
navi_item.itemType = API_LayoutNavItem;
navi_item.customName = true;
strcpy(navi_item.name, "Test Layout");
Where did I go wrong? OR
Is ACAPI_Environment(APIEnv_NewNavigatorViewID) only for views/folder?
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
1 REPLY 1
ReignBough
Enthusiast
My mistake. This should be done with ACAPI_Database(APIDb_NewDatabaseID) instead of ACAPI_Environment(APIEnv_NewNavigatorViewID). There is an example on the documentation, btw.
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS