APIDo_​GoToViewID

Switches to the given navigator view.

    GSErrCode ACAPI_Automate (
        APIDo_GoToViewID,
        const char*     viewGuidStr
    );

 

Parameters

viewGuidStr
[in] string representation of the GUID of the navigator view to be generated

 

Return Values

NoError
the function has completed with success
APIERR_BADPARS
viewGuidStr is nullptr, or not a valid GUID
APIERR_BADID
no view found with the specified GUID
APIERR_GENERAL
failed to generate the view

For other common API errors see the API Errors document.

 

Remarks

This function simulates the action when you open a view from the Project Navigator.

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

 

Example


GSErrCode GoToLinkedDrawingView (const API_Element* drawingElem)
{
    API_DrawingLinkInfo drwLinkInfo;
    BNZeroMemory (&drwLinkInfo, sizeof (API_DrawingLinkInfo));

    GSErrCode err = ACAPI_Database (APIDb_GetDrawingLinkID, (void*) drawingElem->drawing.linkUId, &drwLinkInfo);
    if (drwLinkInfo.linkPath != nullptr)
        delete drwLinkInfo.linkPath;
    if (drwLinkInfo.viewPath != nullptr)
        BMKillPtr (&drwLinkInfo.viewPath);

    if (err == NoError)
        err = ACAPI_Automate (APIDo_GoToViewID, drwLinkInfo.linkGuid, nullptr);

    return err;
}

 

Requirements

Version: API 10 or later
Header: APIdefs_Automate.h

 

See Also

APIDb_GetDrawingLinkID, APIDb_GetDrawingLinkID
APINavigator_GetNavigatorItemID
ACAPI_Automate, API Functions