Table of Contents

Class CadTiledViewports

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

The tiled viewports model space is shown through, as AutoCAD's VPORTS makes them: the *Active records of the drawing's VPORT table, the current one first (CVPORT), and the configurations saved under a name (records of that name). Read from the drawing when first asked for; each change by a command is one undo step; the views and the tiles are written into the drawing when it is saved.

public sealed class CadTiledViewports
Inheritance
CadTiledViewports
Inherited Members

Remarks

-VPORTS 2 Vertical splits the current viewport in two: the current one is the right half, the new one the left, each showing what the current one showed, the whole of its view fitted into the new shape. SIngle keeps the current viewport alone; Save and Restore keep and bring back a configuration by name.

Fields

MaxTiles

The most tiles AutoCAD makes in model space, its MAXACTVP of 64.

Properties

AppliesToCurrentViewport

Gets or sets where the Viewports dialog applies a configuration at first, as -VPORTS MOde sets it: false the whole display (the default), true the current viewport. -VPORTS 2, 3 and 4 split the current viewport whichever it is, as AutoCAD 2021's do (probed with one to seven viewports).

AreaAspect

Gets or sets the width of the drawing area over its height, which the window sets as it is sized: a new tile's view is fitted to its shape by it. 1.6 until the window sets it.

Current

Gets the current tile, the one picks, zooms and commands work in.

IsTiled

Gets whether model space is shown through more than one tile.

Names

Gets the names of the configurations saved, in ordinal order, AutoCAD's own *Multiple left out.

ReadView

Gets or sets what reads the view the window shows in the current tile into it (its centre, width and height), called before the tiles change and before they are saved, so that a new tile starts from the view as it is; null where no window shows them.

StandardNames

The standard configurations of the Viewports dialog, in the order of its list: Single, Two: Vertical, Two: Horizontal, Three: Right, Three: Left, Three: Above, Three: Below, Three: Vertical, Three: Horizontal, Four: Equal, Four: Right and Four: Left.

Tiles

Gets the tiles, the current one first, the others in the order they were made.

Methods

Delete(string)

Deletes the configurations whose names match a pattern (wild cards and commas taken), as -VPORTS Delete, Multiple among them (AutoCAD 2021's deleted three of "Z", "A" and it). One undo step.

Join(int, int)

Joins two tiles into one, as -VPORTS Join: the dominant one keeps its number and its view and takes the place of both. One undo step.

List(string)

Writes "Current configuration:" and the configurations matching a pattern, as -VPORTS ? does.

MakeCurrent(int)

Makes another tile the current one, as a click in it does in AutoCAD: no undo step, as switching viewports is not.

PiecesOf(string)

Gets the tiles of a standard configuration as shares of the area split, (0, 0) to (1, 1), the one that stays current first, for the dialog's preview; null for a name of none.

Rename(string, string)

Renames a configuration saved, as Rename on the Viewports dialog's Named Viewports tab does. One undo step.

Restore(string)

Brings back a configuration saved, the views saved in it, its first tile current, as -VPORTS Restore. One undo step.

Save(string)

Saves the tiles under a name, replacing a configuration of that name, as -VPORTS Save. One undo step.

Saved(string)

Gets the tiles of a configuration saved, the one current when it was saved first; null for none of the name.

ShowViews(IReadOnlyList<string>)

Shows model views in the tiles as they are, as the Viewports dialog's Change view to does with Active Model Configuration picked: each tile, in the order of Tiles, the view its entry names, its centre kept and its size fitted to the tile; an entry that is null, Current or no model view leaves its tile as it is. One undo step; nothing where no entry names a view.

Single()

Shows model space through the current tile alone, as -VPORTS SIngle; nothing where it is alone already. One undo step.

Split(int, string, bool)

Splits the current tile, or the whole drawing area, into the configuration given, as -VPORTS 2, 3 and 4 and the Viewports dialog do: count 2 with Horizontal or Vertical, 3 with Horizontal, Vertical, Above, Below, Left or Right, 4 into four equal tiles. One undo step.

SplitAs(string, bool)

Applies a standard configuration of the Viewports dialog to the whole drawing area (Apply to: Display) or to the current tile (Apply to: Current Viewport); Single with Display keeps the current tile alone, with Current Viewport changes nothing. One undo step.

SplitAs(string, bool, IReadOnlyList<string>)

Applies a standard configuration as SplitAs(string, bool), each new tile showing the model view its entry of the views names, as the Viewports dialog's Change view to gives it: the view's centre, its width and height fitted into the tile's shape. An entry that is null, Current or no model view of the drawing keeps the view the tile was split from; Single with a view shows it in the tile kept. One undo step.

Toggle()

Toggle of -VPORTS: the current tile alone, the others kept under *Multiple, where there are several; the tiles kept brought back where it is alone and some are kept, and where none are, four equal tiles (a drawing with one viewport, toggled in AutoCAD 2021, shows the four it keeps as *Multiple). One undo step.

Events

Changed

Raised when the tiles change, or another becomes the current one.