Performs a zoom operation.

    GSErrCode ACAPI_Automate (
        API_Box*      zoomBox,
        API_Rect*     zoomRect,
        API_Tranmat*  tranmat



[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)
[in] Transformation matrix (optional parameter)


Return Values

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

For other common API errors see the API Errors document.



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.



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



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