C++
ACCORE_PORT Acad::ErrorStatus acedSetCurrentVPort( const AcDbViewport* pVp );
File
aced.h
Description
This function sets the current viewport from the AcDbViewport object pointed to by pVp.
SysVarWillChange and SysVarChanged notification are generated by this function.
You must be in model space for this function to work properly.
This can be done using the following steps:
- Turn TILEMODE off and switch to paper space if necessary.
- Create a viewport using acedCommand/MVIEW.
- Use acedCommand/zoom-extents to ensure that the view was on the screen.
- Make sure that the viewport was turned on using acedCommand MVIEW/ON last.
- Switch to model space using acedCommand /MSPACE.
- Set CVPORT to the number of your viewport to ensure that your viewport is active.
- Instantiate a viewport object
- Turn TILEMODE off and switch to paper space if necessary.
- Use acedSetCurrentView to zoom out to make sure that the viewport is viewable.
- Open the viewport for write, and ensure that it is activated.
- Switch to model space using acedSetCurrentView.
- Close the viewport.
Parameters
Parameters | Description |
---|---|
pVp | Input pointer to viewport to make current |
Returns
Returns Acad::eOk if successful.
Returns Acad::eOutOfRange if the specified viewport isn't valid for the current environment.
Returns Acad::eNullObjectPointer if pVP is NULL.
Previous Declaration
AutoCAD 2025 and Earlier
Acad::ErrorStatus acedSetCurrentVPort(const AcDbViewport* pVp);