APIDo_​ZoomID

Performs a zoom operation.

    GSErrCode ACAPI_Automate (
        APIDo_ZoomID,
        API_Box*      zoomBox,
        API_Rect*     zoomRect,
        API_Tranmat*  tranmat
    );

 

Parameters

zoomBox
[in] The box to zoom in (optional parameter, can be nullptr)
zoomRect Featuring API 10
[in] Zoom rectangle (optional parameter, alternative of zoomBox, can be nullptr)
tranmat
[in] Transformation matrix (optional parameter)

 

Return Values

NoError
The function has completed with success
APIERR_NOPLAN
There is no open project
APIERR_BADDATABASE
The active database is not the top window
APIERR_BADPARS
The passed zoomBox is incorrect (empty box) or zoomRect is too small

For other common API errors see the API Errors document.

 

Remarks

This function performs a zoom or a fit in window operation on the front window, and rebuilds it.

If the zoomBox parameter is passed, the given zoom factor will be set up. Alternatively you can pass a rectangle to define the zoom in pixel coordinates. If both parameters are nullptr, a Fit In Window command will be executed.

To set the zoom box of a 2D drawing type window without rebuilding the database, use the APIDb_SetZoomID database function. You can retrieve the current zoom box of a 2D drawing type window with APIDb_GetZoomID.

Featuring API 10  If the top window is the 3D model window, only the zoomRect parameter is considered. You can retrieve the current window size with the APIEnv_Get3DWindowSetsID environment function.

You can also modify the zoom of the 3D model window with the APIEnv_Change3DWindowSetsID environment function.

 

Example


ACAPI_Automate (APIDo_ZoomID, nullptr, nullptr);  // fit in window

 

Requirements

Version: API 2.1 or later
Header: APIdefs_Automate.h

 

See Also

API_Box, API_Rect, API_Tranmat
APIDb_SetZoomID, APIDb_GetZoomID, APIDb_ReSetZoomID
APIEnv_Get3DWindowSetsID, APIEnv_Change3DWindowSetsID
ACAPI_Automate, API Functions