[SOLVED] APIEnv_SearchNavigatorItemID not working correctly?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-04-21
07:44 AM
- last edited on
‎2023-07-12
08:44 PM
by
Doreena Deng
‎2017-04-21
07:44 AM
Hi All
I am trying to create an addon that searches through all navigator items and changes various view settings. All is working well but I have found the search is only working for floor plan and perspective view types.
the code below comes directly from the API devkit. It will loop through all the floor plan views. But if you change it to loop through sections - it will not work. (oddly - perspective views seem to work) (also setting db.typeID seems to have no effect)
I am changing this line of code
item.itemType = API_StoryNavItem;
to this
item.itemType = API_SectionNavItem
which will work with floor plans and perspectives - but nothing else??
any help - much appreciated!!
I am trying to create an addon that searches through all navigator items and changes various view settings. All is working well but I have found the search is only working for floor plan and perspective view types.
the code below comes directly from the API devkit. It will loop through all the floor plan views. But if you change it to loop through sections - it will not work. (oddly - perspective views seem to work) (also setting db.typeID seems to have no effect)
I am changing this line of code
item.itemType = API_StoryNavItem;
to this
item.itemType = API_SectionNavItem
which will work with floor plans and perspectives - but nothing else??
any help - much appreciated!!

GSErrCode err = NoError; API_DatabaseInfo db; BNZeroMemory (&db, sizeof (API_DatabaseInfo)); db.typeID = APIWind_FloorPlanID; API_NavigatorView view; API_NavigatorItem parent; API_NavigatorItem item; API_NavigatorItem** items = NULL; BNZeroMemory (&item, sizeof (API_NavigatorItem)); item.itemType = API_StoryNavItem item.mapId = API_PublicViewMap; db.typeID = APIWind_FloorPlanID; err = ACAPI_Environment (APIEnv_SearchNavigatorItemID, &item, &items, NULL); if (err != NoError || items == NULL) return; char str[256]; Int32 num; Int32 n = BMhGetSize ((GSHandle) items) / sizeof (API_NavigatorItem); ACAPI_WriteReport ("Stories of View Map:", false); for (Int32 i = 0; i < n; i++) { sprintf (str, "%s", (*items).name); ACAPI_WriteReport (str, false); BNZeroMemory (&parent, sizeof (API_NavigatorItem)); parent.mapId = API_PublicViewMap; err = ACAPI_Environment (APIEnv_GetNavigatorParentItemID, (*items).guid, &parent, NULL); sprintf (str, " - parent name: %s", parent.name); ACAPI_WriteReport (str, false); err = ACAPI_Environment (APIEnv_GetNavigatorChildNumID, &parent, &num, NULL); sprintf (str, " - number of children of the parent: %d", num); ACAPI_WriteReport (str, false); BNZeroMemory (&view, sizeof (API_NavigatorView)); err = ACAPI_Environment (APIEnv_GetNavigatorViewID, &((*items)), &view, NULL); if (view.saveLaySet) { if (view.layerCombination[0] != 0) sprintf (str, " - Layer combination: %s", view.layerCombination); else sprintf (str, " - Layers individual"); } else { sprintf (str, " - none layers"); } BMhKill ((GSHandle*) &view.layerStats); ACAPI_WriteReport (str, false); } BMhKill ((GSHandle *) &items);
Labels:
- Labels:
-
Add-On (C++)
10 REPLIES 10

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-05-18 11:20 AM
‎2017-05-18
11:20 AM
Hi Ben,
I'm glad it was helpful for you!
Regina
I'm glad it was helpful for you!

Regina
- « Previous
-
- 1
- 2
- Next »
- « Previous
-
- 1
- 2
- Next »