CadTiledViewports
from OpenCAD2D import CadTiledViewports
class CadTiledViewports(System.Object) ยท CadTiledViewports in the .NET reference
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.
Properties and fields
MaxTiles
MaxTiles: ClassVar[int]
The most tiles AutoCAD makes in model space, its MAXACTVP of 64.
AppliesToCurrentViewport
@property
def AppliesToCurrentViewport(self) -> bool
@AppliesToCurrentViewport.setter
def AppliesToCurrentViewport(self, value: bool) -> None
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
@property
def AreaAspect(self) -> float
@AreaAspect.setter
def AreaAspect(self, value: float) -> None
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
@property
def Current(self) -> CadTiledViewport
Gets the current tile, the one picks, zooms and commands work in.
IsTiled
@property
def IsTiled(self) -> bool
Gets whether model space is shown through more than one tile.
Names
@property
def Names(self) -> System.Collections.Generic.IReadOnlyList[str]
Gets the names of the configurations saved, in ordinal order, AutoCAD's own *Multiple left out.
ReadView
@property
def ReadView(self) -> System.Action[CadTiledViewport] | None
@ReadView.setter
def ReadView(self, value: System.Action[CadTiledViewport] | None) -> None
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
StandardNames: ClassVar[System.Collections.Generic.IReadOnlyList[str]]
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
@property
def Tiles(self) -> System.Collections.Generic.IReadOnlyList[CadTiledViewport]
Gets the tiles, the current one first, the others in the order they were made.
Events
Changed
@property
def Changed(self) -> System.EventHandler[System.EventArgs]
@Changed.setter
def Changed(self, value: System.EventHandler[System.EventArgs]) -> None
Raised when the tiles change, or another becomes the current one.
Methods
Delete
def Delete(self, pattern: str) -> int
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
def Join(self, dominant: int, other: int) -> str
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
def List(self, pattern: str) -> System.Collections.Generic.IReadOnlyList[str]
Writes "Current configuration:" and the configurations matching a pattern, as -VPORTS ? does.
MakeCurrent
def MakeCurrent(self, id: int) -> bool
Makes another tile the current one, as a click in it does in AutoCAD: no undo step, as switching viewports is not.
PiecesOf
@staticmethod
def PiecesOf(name: str) -> System.Collections.Generic.IReadOnlyList[DisplayBox]
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
def Rename(self, name: str, newName: str) -> str
Renames a configuration saved, as Rename on the Viewports dialog's Named Viewports tab does. One undo step.
Restore
def Restore(self, name: str) -> bool
Brings back a configuration saved, the views saved in it, its first tile current, as -VPORTS Restore. One undo step.
Save
def Save(self, name: str) -> None
Saves the tiles under a name, replacing a configuration of that name, as -VPORTS Save. One undo step.
Saved
def Saved(self, name: str) -> System.Collections.Generic.IReadOnlyList[CadTiledViewport]
Gets the tiles of a configuration saved, the one current when it was saved first; null for none of the name.
ShowViews
def ShowViews(self, views: System.Collections.Generic.IReadOnlyList[str]) -> bool
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 CadTiledViewports.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
def Single(self) -> bool
Shows model space through the current tile alone, as -VPORTS SIngle; nothing where it is alone already. One undo step.
Split
def Split(self, count: int, arrangement: str, whole: bool) -> str
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
def SplitAs(self, name: str, whole: bool) -> str
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.
def SplitAs(self, name: str, whole: bool, views: System.Collections.Generic.IReadOnlyList[str]) -> str
Applies a standard configuration as CadTiledViewports.SplitAs, 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
def Toggle(self) -> bool
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.