Description
This .NET class wraps the AcGiViewportDraw ObjectARX class.
The ViewportDraw class is a container class that provides the ability to generate different geometry for different viewports. During entity regeneration, an entity's ViewportDraw() method is only called if the entity's WorldDraw() method returns false.
The default constructor creates new ViewportGeometry, SubEntityTraits, and Viewport objects, all of which are accessible via functions in the AViewportDraw object.
An object of class ViewportDraw is passed into the Entity.ViewportDraw() function.
The ViewportDraw class provides functions that return references to objects of other key graphics interface classes. From ViewportDraw, you can obtain objects of the following classes:
Class | Usage |
---|---|
SubEntityTraits | Setting drawing attributes (color, linetype, etc.) and selection markers. |
ViewportGeometry | Drawing model coordinate geometry (arcs, polylines, etc.); getting current transforms. |
An example of an entity that should use the ViewportDraw is a cylinder represented by just using two circles and two lines. The two circles could be drawn in the entity's WorldDraw() method, but where the lines should be drawn depends on the viewpoint of each viewport and hence should be calculated and drawn in the entity's ViewportDraw() method. Here the circles' world coordinate geometry is the same for all views but the lines will have to be generated to line up with the circles to produce the right appearance given each viewport's possibly different vantage point of the cylinder.
Class Hierarchy
Autodesk.AutoCAD.GraphicsInterface.CommonDraw Autodesk.AutoCAD.GraphicsInterface.ViewportDraw
C#
public abstract class ViewportDraw : CommonDraw;
Visual Basic
Public abstract Class ViewportDraw Inherits CommonDraw
Links
ViewportDraw Constructor, ViewportDraw Methods, ViewportDraw Properties
See Also
ViewportGeometry, SubEntityTraits, WorldDraw