APINavigator_​SearchNavigatorItemID

Searches the navigator items of the requested database.

    GSErrCode ACAPI_Navigator (
        APINavigator_SearchNavigatorItemID,
        API_NavigatorItem*            item,
        API_NavigatorItem***          items,
        GS::Array<API_NavigatorItem>* itemsArray
    );

 

Parameters

item
[in] The identification parameters of the requested Viewpoint/database. The itemType parameter is compulsory.
items
[out] The navigator items matching the specified Viewpoint/database (optional parameter)
itemsArray
[out] Same as the items parameter but as a GS::Array (optional parameter)

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
The item parameter is nullptr or contains invalid data, or both the items and itemsArray parameters are nullptr.
APIERR_GENERAL
No open project.

 

Remarks

This function retrieves the items of the Project Navigator which refer to the specified Viewpoint/database.

Do not forget to dispose the items handle if it is not needed any more.

 

Example


GSErrCode err = NoError;

API_NavigatorView   view;
API_NavigatorItem   parent;
API_NavigatorItem   item = {};
GS::Array<API_NavigatorItem> items;

item.itemType = API_StoryNavItem;
item.mapId    = API_PublicViewMap;

err = ACAPI_Navigator (APINavigator_SearchNavigatorItemID, &item, nullptr, &items);
if (err != NoError)
    return;

char    str[256];
Int32   num;

ACAPI_WriteReport ("Stories of View Map:", false);

for (const API_NavigatorItem& navItem : items) {
    sprintf (str, "%s", GS::UniString (navItem.uName).ToCStr ().Get ());
    ACAPI_WriteReport (str, false);

    BNZeroMemory (&parent, sizeof (API_NavigatorItem));
    parent.mapId = API_PublicViewMap;
    err = ACAPI_Navigator (APINavigator_GetNavigatorParentItemID, navItem.guid, &parent, nullptr);
    sprintf (str, " - parent name: %s", GS::UniString (parent.uName).ToCStr ().Get ());
    ACAPI_WriteReport (str, false);

    err = ACAPI_Navigator (APINavigator_GetNavigatorChildNumID, &parent, &num, nullptr);
    sprintf (str, " - number of children of the parent: %d", num);
    ACAPI_WriteReport (str, false);

    BNZeroMemory (&view, sizeof (API_NavigatorView));
    err = ACAPI_Navigator (APINavigator_GetNavigatorViewID, &navItem, &view, nullptr);
    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);
}

 

Requirements

Version: API 4.3 or later
Header: APIdefs_Navigator.h

 

See Also

API_NavigatorItem
APINavigator_GetNavigatorItemID
APINavigator_GetNavigatorParentItemID
APINavigator_GetNavigatorChildrenItemsID
ACAPI_Navigator
API Functions