Table of Contents

Class CadViewports

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

The arithmetic of model space seen through a viewport of a layout: the view of the canvas in model units, the view a viewport takes from it back, a box of model space fitted to the frame, and the scales a viewport is set to.

public static class CadViewports
Inheritance
CadViewports
Inherited Members

Properties

StandardScales

Gets the standard scales a viewport is set to, as the status bar and the Properties' Standard scale offer them: 1:1, 1:2, 1:4, 1:5, 1:8, 1:10, 1:16, 1:20, 1:30, 1:40, 1:50, 1:100, 2:1, 4:1, 8:1, 10:1 and 100:1.

Methods

CanWorkThrough(DxfViewport)

Gets whether a viewport's model space can be worked in through it: on and not the sheet's own, with a frame and a view of some size, its view a plan seen from above (the canvas shows model space through it at one scale). A plan twisted (group 51) is one: the canvas shows it turned, the cursor, the crosshair and the UCS icon with it.

Fit(DxfViewport, DisplayBox, out GeoPoint2, out double)

The view that shows a box of model space wholly in a viewport's frame, as ZOOM Window or Extents in a viewport: about the box's middle, as high as the box or as its width needs in the frame's proportion; through a twisted view, the box as the view turns it.

FromView(DxfViewport, GeoPoint2)

The point of model space a point in the coordinates of a viewport's view stands for: the way back from ToView(DxfViewport, GeoPoint2).

HasPlanView(DxfViewport)

Gets whether a viewport looks straight down on model space, its view direction (group 16) the world's Z: the only view the canvas can work through, and the one the display draws as a plan, without a projection. A viewport set up in AutoCAD with a south-east isometric view, direction (1, -1, 1), has none; nor has one that looks from below.

ModelView(CadView, DxfViewport)

The view of the canvas in model units through a viewport: the paper view scaled by the viewport's scale, about the point of model space under the middle of the canvas. A viewport at 1:20 seen at 2 pixels to the paper unit is seen at a tenth of a pixel to the model unit.

ScaleName(double)

The name of a viewport's scale, the paper's units to the model's: a standard one as the list writes it, 1:50; another to the third place, 1:37.5 or 3.125:1.

ToModel(DxfViewport, GeoPoint2)

The point of model space a point of the paper shows through a viewport.

ToPaper(DxfViewport, GeoPoint2)

The point of the paper a point of model space is shown at through a viewport.

ToView(DxfViewport, GeoPoint2)

A point of model space in the coordinates of a viewport's view, as AutoCAD's display coordinates (TRANS 0 to 2): about the view's target and turned by its twist. Through a viewport twisted 30 degrees about the origin, (100, 0) is (86.603, 50).

ToView(DxfViewport, GeoPoint3)

A point of model space, height and all, in the coordinates of a viewport's view, as AutoCAD's display coordinates (TRANS 0 to 2): the point taken from the view's target, along the view's axes, then turned by its twist. Through a viewport looking from (1, -1, 1), the point (100, 0, 0) is (70.711, -40.825), (0, 0, 100) is (0, 81.650), and the depth, which is its third coordinate, is dropped. Through a plan it is the point of ToView(DxfViewport, GeoPoint2) whatever its height.

TryReadScale(string, out double)

The paper length of one model unit a scale's name gives, 0.02 for 1:50; false for a name that is none.

ViewBox(DxfViewport)

The box of model space a viewport's frame shows: through a twisted view, the box about the frame turned.

ViewOf(CadView, CadView, DxfViewport, out GeoPoint2, out double)

The view a viewport takes from a view of the canvas in model units, the paper's staying as it is: the scale the two zooms give and the model point at the middle of the frame. The way back from ModelView(CadView, DxfViewport), so a model view zoomed about the cursor gives the viewport's view zoomed there.