Restores the zoom parameters of the current database by a given number of steps.
GSErrCode ACAPI_Database ( APIDb_ReSetZoomID, short* numOfStepsBack );
Parameters
- numOfStepsBack
- [in] Number of steps to go back among the previous zoom boxes
Return Values
NoError
- The function has completed with success.
APIERR_NOPLAN
- No open project.
APIERR_BADDATABASE
- The current database does not match to the current window. (This function works only in this case.)
APIERR_BADPARS
- The step number is less than 1 or greater than the number of currently stored zooms.
Remarks
This function is used to restore one of the previous zooms. The database will not be rebuilt.
If the numOfStepsBack
parameter is nullptr
, the initial zoom is restored, and all the other stored zooms will be erased.
To get the actual zoom box refer to the APIDb_GetZoomID function. To change the actual zoom box refer to the APIDb_SetZoomID and the APIDo_ZoomID functions.
Example
GSErrCode err; API_Box zoomBox; API_PrintPars printPars; short numOfStepsBack; BNZeroMemory (&zoomBox, sizeof (API_Box)); zoomBox.xMin = -1.5; zoomBox.yMin = 0.0; zoomBox.xMax = 1.5; zoomBox.yMax = 3.0; err = ACAPI_Automate (APIDo_ZoomID, &zoomBox, nullptr); if (err == NoError) { BNZeroMemory (&printPars, sizeof (API_PrintPars)); printPars.printArea = PrintArea_CurrentView; err = ACAPI_Automate (APIDo_PrintID, &printPars, nullptr); numOfStepsBack = 1; ACAPI_Database (APIDb_ReSetZoomID, &numOfStepsBack, nullptr); ACAPI_Automate (APIDo_RebuildID, nullptr, nullptr); }
Requirements
- Version: API 4.1 or later
- Header: APIdefs_Database.h
See Also
APIDb_GetZoomID, APIDb_SetZoomID APIDo_ZoomID,
ACAPI_Database, API Functions