Share

acedSetCurrentVPort

C++

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:

  1. Turn TILEMODE off and switch to paper space if necessary.
  1. Create a viewport using acedCommand/MVIEW.
  1. Use acedCommand/zoom-extents to ensure that the view was on the screen.
  1. Make sure that the viewport was turned on using acedCommand MVIEW/ON last.
  1. Switch to model space using acedCommand /MSPACE.
  1. Set CVPORT to the number of your viewport to ensure that your viewport is active.

Alternatively, to avoid the use of acedCommand, you can use the following steps:

  1. Instantiate a viewport object
  1. Turn TILEMODE off and switch to paper space if necessary.
  1. Use acedSetCurrentView to zoom out to make sure that the viewport is viewable.
  1. Open the viewport for write, and ensure that it is activated.
  1. Switch to model space using acedSetCurrentView.
  1. Close the viewport.

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.

Parameters

Parameters Description
pVp Input pointer to viewport to make current

Was this information helpful?