APIEnv_​ChangeNavigatorItemID

Modifies the given Project Navigator item.

    GSErrCode ACAPI_Environment (
        APIEnv_ChangeNavigatorItemID,
        API_NavigatorItem*     navigatorItem
    );

 

Parameters

navigatorItem
[in] The navigator item identified with its guid.

 

Return Values

APIERR_BADPARS
The specified navigator item doesn’t exist neither in Public View Map nor in My View Map (TeamWork mode).
APIERR_NOTMINE
You have no permission to change the item.
NoError
The function has completed with success.

For other common API errors see the API Errors document.

 

Remarks

Use this function to change a Project Navigator item’s name or ID. Only View Map items are modifiable.

This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.

 

Example


API_NavigatorItem navItem;
BNZeroMemory (&navItem, sizeof(API_NavigatorItem));
navItem.mapId = API_PublicViewMap;    //for performance
if (ACAPI_Environment (APIEnv_GetNavigatorItemID, guid, &navItem)== NoError) {
    //name
    if (navItem.customName) {
        navItem.customName = false;
    } else {
        navItem.customName = true;
        CHCopyC ("Name from API", navItem.name);
    }

    //uiId
    if (navItem.customUiId) {
        navItem.customUiId = false;
    } else {
        navItem.customUiId = true;
        CHCopyC ("ID from API", navItem.uiId);
    }

    err = ACAPI_Environment (APIEnv_ChangeNavigatorItemID, &navItem);
}

 

Requirements

Version: API 18 or later
Header: APIdefs_Environment.h

 

See Also

ACAPI_Environment,
API Functions