CadLayerStatesRequest
from OpenCAD2D import CadLayerStatesRequest
class CadLayerStatesRequest(System.Object) · CadLayerStatesRequest in the .NET reference
The Layer States Manager of LAYERSTATE, as data its command and the window share: the states of the drawing, the one chosen, the restore options and the properties it restores. New, Update, Rename, Delete, Import, Export and the properties ticked change the drawing while the dialog stays open, each as an edit of the command's one undo step; Restore restores the state chosen and closes it, Close keeps every change.
Properties and fields
Action
@property
def Action(self) -> CadDialogAction
@Action.setter
def Action(self, value: CadDialogAction) -> None
Gets or sets what the dialog was closed with: OK for Restore, Cancel for Close; Cancel until set.
AsViewportOverrides
@property
def AsViewportOverrides(self) -> bool
@AsViewportOverrides.setter
def AsViewportOverrides(self, value: bool) -> None
Gets or sets whether Restore puts the properties on the current viewport as overrides; only in a layout.
Current
@property
def Current(self) -> str
Gets the name of the state the drawing is as, or *UNSAVED* where no state is the same as the drawing.
Document
@property
def Document(self) -> CadDocument
Gets the document.
HideXrefStates
@property
def HideXrefStates(self) -> bool
@HideXrefStates.setter
def HideXrefStates(self, value: bool) -> None
Gets or sets whether the states of xrefs are left out of the list (Don't list layer states in Xrefs); true until set.
IsModelSpace
@property
def IsModelSpace(self) -> bool
Gets whether the drawing shows model space, where Apply properties as viewport overrides is greyed.
Message
@property
def Message(self) -> str | None
Gets what the last change said where it was refused, as "A layer state named Plan already exists."; null where it was made.
Selected
@property
def Selected(self) -> str | None
@Selected.setter
def Selected(self, value: str | None) -> None
Gets or sets the name of the state chosen; null for none.
States
@property
def States(self) -> System.Collections.Generic.IReadOnlyList[CadLayerStateRow]
Gets the states listed, in ordinal order of their names, letters of either case alike; a named view's snapshot is not among them.
TurnOffMissing
@property
def TurnOffMissing(self) -> bool
@TurnOffMissing.setter
def TurnOffMissing(self, value: bool) -> None
Gets or sets whether Restore turns off the layers the state does not name (Turn off layers not found in layer state).
Methods
BeginEdit
def BeginEdit(self) -> CadLayerStateEdit
Edit…: the layers of the state chosen, to be changed and written back by CadLayerStatesRequest.Edit.
Delete
def Delete(self) -> bool
Delete: the state chosen taken out.
Edit
def Edit(self, edit: CadLayerStateEdit) -> bool
OK of Edit Layer State: the state written from the edit, its layers and the properties it restores.
Export
def Export(self, path: str) -> bool
Export: the state chosen written to a .las file.
Has
def Has(self, name: str) -> bool
Gets whether the drawing has a state of a name, letters of either case the same, as New asks before it replaces one.
Import
def Import(self, path: str) -> bool
Import: the states of a .las file read into the drawing.
New
def New(self, name: str, description: str) -> bool
New: the layers as they stand saved as a new state.
Relist
def Relist(self) -> None
The states read again from the drawing, as CadLayerStatesRequest.HideXrefStates switched lists them.
Rename
def Rename(self, name: str) -> bool
Rename: the state chosen given a new name.
Replace
def Replace(self, name: str, description: str) -> bool
New over a state of the name: the state replaced by the layers as they stand, its description by the one given and the properties it restores kept, as AutoCAD's New does once its question is answered Yes.
SetMask
def SetMask(self, mask: int) -> bool
The properties the state chosen restores, as AutoCAD's mask (1 on, 2 frozen, 4 locked, 8 plot, 0x20 colour and on).
Update
def Update(self) -> bool
Update: the state chosen saved again from the layers as they stand, its properties kept.