PViewport object (ActiveX)

Rectangular objects created in paper space that display views.

Supported Platforms: Windows only

Class Information

Class Name

AcadPViewport

Object Inheritance
Object
   AcadObject
      AcadEntity
         AcadPViewport
Create Using

VBA

PaperSpace.AddPViewport
Access Via

VBA

PaperSpace.Item
Document.ActivePViewport

Members

These members are part of this object:

Remarks

The functionality of the PViewport object is slightly different from what is used in the AutoCAD user interface. Users familiar with AutoCAD paper space viewport functionality will find the following information helpful.

In ActiveX Automation, the ActiveSpace property is used to control the TILEMODE system variable. Setting ThisDrawing.ActiveSpace = acModelSpace is equivalent to setting TILEMODE = 1, and setting ThisDrawing.ActiveSpace = acPaperSpace is equivalent to setting TILEMODE = 0.

Similarly, the MSpace property is the equivalent of both the MSPACE and PSPACE commands in AutoCAD. Setting ThisDrawing.MSpace = True is the same as using the MSPACE command, and setting ThisDrawing.MSpace = False is the same as using the PSPACE command.

In addition, the ActiveX Automation user is required to use the Display method before setting the MSpace property to True. The Display method initializes certain graphic settings that must be set before switching to model space. In AutoCAD this is done "behind the scenes." However, in the ActiveX Automation interface, the programmer must take care of this initialization.

Note: Remember, you must turn on the display using the Display method for at least one PViewport object before you can set the MSpace property to True. Failure to turn on the display will result in an error being returned when you try to set the MSpace property.

The ActiveSpace and MSpace properties are found on the Document object.

To create a PViewport object, use the AddPViewport method.