Show / Hide Table of Contents

Class Viewport

Represents a view in paper space of the model.

Inheritance
System.Object
DxfObject
EntityObject
Viewport
Implements
IHasXData
System.ICloneable
Inherited Members
EntityObject.LayerChanged
EntityObject.OnLayerChangedEvent(Layer, Layer)
EntityObject.LinetypeChanged
EntityObject.OnLinetypeChangedEvent(Linetype, Linetype)
EntityObject.XDataAddAppReg
EntityObject.OnXDataAddAppRegEvent(ApplicationRegistry)
EntityObject.XDataRemoveAppReg
EntityObject.OnXDataRemoveAppRegEvent(ApplicationRegistry)
EntityObject.Reactors
EntityObject.Type
EntityObject.Color
EntityObject.Layer
EntityObject.Linetype
EntityObject.Lineweight
EntityObject.Transparency
EntityObject.LinetypeScale
EntityObject.IsVisible
EntityObject.Normal
EntityObject.Owner
EntityObject.XData
EntityObject.TransformBy(Matrix4)
EntityObject.ToString()
DxfObject.CodeName
DxfObject.Handle
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public class Viewport : EntityObject, IHasXData, ICloneable
Remarks

The viewport with id equals 1 is the view of the paper space layout itself and it does not show the model.

Constructors

| Improve this Doc View Source

Viewport()

Initializes a new viewport object.

Declaration
public Viewport()
| Improve this Doc View Source

Viewport(EntityObject)

Declaration
public Viewport(EntityObject clippingBoundary)
Parameters
Type Name Description
EntityObject clippingBoundary
| Improve this Doc View Source

Viewport(Vector2, Vector2)

Declaration
public Viewport(Vector2 bottomLeftCorner, Vector2 topRightCorner)
Parameters
Type Name Description
Vector2 bottomLeftCorner
Vector2 topRightCorner
| Improve this Doc View Source

Viewport(Vector2, Double, Double)

Declaration
public Viewport(Vector2 center, double width, double height)
Parameters
Type Name Description
Vector2 center
System.Double width
System.Double height

Properties

| Improve this Doc View Source

BackClipPlane

Gets or sets the back clip plane Z value.

Declaration
public double BackClipPlane { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Center

Gets or sets the center point in paper space units.

Declaration
public Vector3 Center { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

CircleZoomPercent

Gets or sets the circle zoom percent.

Declaration
public short CircleZoomPercent { get; set; }
Property Value
Type Description
System.Int16
| Improve this Doc View Source

ClippingBoundary

Entity that serves as the viewport clipping boundary (only present if viewport is non-rectangular).

Declaration
public EntityObject ClippingBoundary { get; set; }
Property Value
Type Description
EntityObject
Remarks

AutoCad does not allow the creation of viewports from open shapes such as LwPolylines, Polylines, or ellipse arcs; but if they are edited afterward, making them open, it will not complain, and they will work without problems. So, it is possible to use open shapes as clipping boundaries, even if it is not recommended. It might not be supported by all programs that read DXF files and a redraw of the layout might be required to show them correctly inside AutoCad.
Only X and Y coordinates will be used the entity normal will be considered as UnitZ.
When the viewport is added to the document this entity will be added too.

| Improve this Doc View Source

Elevation

Gets or sets the elevation.

Declaration
public double Elevation { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

FrontClipPlane

Gets or sets the front clip plane Z value.

Declaration
public double FrontClipPlane { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

FrozenLayers

Gets the list of layers that are frozen in this viewport.

Declaration
public List<Layer> FrozenLayers { get; }
Property Value
Type Description
System.Collections.Generic.List<Layer>
| Improve this Doc View Source

GridSpacing

Gets or sets the grid spacing.

Declaration
public Vector2 GridSpacing { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

Height

Gets or sets the height in paper space units.

Declaration
public double Height { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

LensLength

Gets or sets the perspective lens length.

Declaration
public double LensLength { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

SnapAngle

Gets or sets the snap angle.

Declaration
public double SnapAngle { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

SnapBase

Gets or sets the snap base point.

Declaration
public Vector2 SnapBase { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

SnapSpacing

Gets or sets the snap spacing.

Declaration
public Vector2 SnapSpacing { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

Stacking

Viewport status field:
-1 = On, but is fully off screen, or is one of the viewports that is not active because the $MAXACTVP count is currently being exceeded.
0 = Off
1 = Stacking value reserved for the layout view. positive value = On and active. The value indicates the order of stacking for the viewports, where 1 is the active viewport, 2 is the next, and so forth.

Declaration
public short Stacking { get; set; }
Property Value
Type Description
System.Int16
| Improve this Doc View Source

Status

Gets or sets the ViewportStatusFlags:

Declaration
public ViewportStatusFlags Status { get; set; }
Property Value
Type Description
ViewportStatusFlags
| Improve this Doc View Source

TwistAngle

Gets or sets the view twist angle.

Declaration
public double TwistAngle { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

UcsOrigin

Gets or sets the UCS origin.

Declaration
public Vector3 UcsOrigin { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

UcsXAxis

Gets or sets the UCS X axis.

Declaration
public Vector3 UcsXAxis { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

UcsYAxis

Gets or sets the UCS Y axis.

Declaration
public Vector3 UcsYAxis { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

ViewCenter

Gets or sets the view center point (in DCS).

Declaration
public Vector2 ViewCenter { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

ViewDirection

Gets or sets the view direction vector (in WCS).

Declaration
public Vector3 ViewDirection { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

ViewHeight

Gets or sets the view height (in model space units).

Declaration
public double ViewHeight { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

ViewTarget

Gets or sets the view target point (in WCS).

Declaration
public Vector3 ViewTarget { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

Width

Gets or sets the width in paper space units.

Declaration
public double Width { get; set; }
Property Value
Type Description
System.Double

Methods

| Improve this Doc View Source

Clone()

Creates a new viewport that is a copy of the current instance.

Declaration
public override object Clone()
Returns
Type Description
System.Object

A new viewport that is a copy of this instance.

Overrides
EntityObject.Clone()
| Improve this Doc View Source

OnClippingBoundaryAddedEvent(EntityObject)

Declaration
protected virtual void OnClippingBoundaryAddedEvent(EntityObject item)
Parameters
Type Name Description
EntityObject item
| Improve this Doc View Source

OnClippingBoundaryRemovedEvent(EntityObject)

Declaration
protected virtual void OnClippingBoundaryRemovedEvent(EntityObject item)
Parameters
Type Name Description
EntityObject item
| Improve this Doc View Source

TransformBy(Matrix3, Vector3)

Moves, scales, and/or rotates the current entity given a 3x3 transformation matrix and a translation vector.

Declaration
public override void TransformBy(Matrix3 transformation, Vector3 translation)
Parameters
Type Name Description
Matrix3 transformation

Transformation matrix.

Vector3 translation

Translation vector.

Overrides
EntityObject.TransformBy(Matrix3, Vector3)
Remarks

Matrix3 adopts the convention of using column vectors to represent a transformation matrix.

Events

| Improve this Doc View Source

ClippingBoundaryAdded

Declaration
public event Viewport.ClippingBoundaryAddedEventHandler ClippingBoundaryAdded
Event Type
Type Description
Viewport.ClippingBoundaryAddedEventHandler
| Improve this Doc View Source

ClippingBoundaryRemoved

Declaration
public event Viewport.ClippingBoundaryRemovedEventHandler ClippingBoundaryRemoved
Event Type
Type Description
Viewport.ClippingBoundaryRemovedEventHandler

Implements

IHasXData
System.ICloneable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX