APIEnv_​Change3DProjectionSetsID

Changes the parameters of the 3D projection.

    GSErrCode ACAPI_Environment (
        APIEnv_Change3DProjectionSetsID,
        API_3DProjectionInfo*     proj3DInfo,
        bool*                     switchOnlyAxonoOrPersp
    );

 

Parameters

proj3DInfo
[in] Parameters of the ‘3D Projection Settings…’ dialog
switchOnlyAxonoOrPersp
[in] Optional parameter. If it is not nullptr and the value is true, only the isPersp field of proj3DInfo is considered

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
proj3DInfo is nullptr
APIERR_NOPLAN
No open project

For other common API errors see the API Errors document.

 

Remarks

This function is used to change the 3D projection.

If you pass true in the switchOnlyAxoOrPersp parameter, the kind of the projection (parallel or perspective) will be changed only, all the other parameters will be ignored.
If the value of camGuid or actCamSet field of API_3DProjectionInfo is non-zero, the perspective projection will be defined according to the camera identified by camGuid. If camGuid is invalid, the first camera of the camera set defined by the actCamSet field will be used. Otherwise the perspective settings will not be related to any floorplan camera element, and will be defined by the API_PerspPars data. These fields are irrelevant when changing the axonometric projection parameters.

 

Example


/* Change to the next perspective camera */
API_Element           element;
API_3DProjectionInfo  proj3DInfo;
GSErrCode             err;

BNZeroMemory (&proj3DInfo, sizeof (API_3DProjectionInfo));
err = ACAPI_Environment (APIEnv_Get3DProjectionSetsID, &proj3DInfo, nullptr, nullptr);
if (err == NoError && proj3DInfo.isPersp && proj3DInfo.camGuid != APINULLGuid) {
    BNZeroMemory (&element, sizeof (API_Element));
    element.header.guid = proj3DInfo.camGuid;
    err = ACAPI_Element_Get (&element);
    if (err == NoError && element.camera.perspCam.nextCam != APINULLGuid) {
        proj3DInfo.camGuid = element.camera.perspCam.nextCam;
        err = ACAPI_Environment (APIEnv_Change3DProjectionSetsID, &proj3DInfo, nullptr, nullptr);
    }
}

Requirements

Version: API 3.1 or later
Header: APIdefs_Environment.h

 

See Also

APIEnv_Get3DProjectionSetsID, ACAPI_Environment, API_3DProjectionInfo, API Functions