CadLayerWalkRequest
from OpenCAD2D import CadLayerWalkRequest
class CadLayerWalkRequest(System.Object) ยท CadLayerWalkRequest in the .NET reference
The LayerWalk dialog of LAYWALK, as data its command and the window share: the layers listed, the filter that narrows them, the layers walked, and the choice to put the layers back as they were when it closes. Walking layers turns every layer but those selected off and thaws those selected, as AutoCAD's LayerWalk shows only the objects on the layers selected; with none selected every layer is as it was. A drawing of the layers WALL, DOOR and TRIM, walked on DOOR, shows the objects on DOOR alone; closed with Restore on exit, it has all three as they were. The changes are edits of the command's one undo step.
Properties and fields
Action
@property
def Action(self) -> CadDialogAction
@Action.setter
def Action(self, value: CadDialogAction) -> None
Gets or sets what the dialog closed with: Cancel for Close, SelectObjects for Select objects, which asks on the canvas and shows the dialog again.
Document
@property
def Document(self) -> CadDocument
Gets the document.
Filter
@property
def Filter(self) -> str
@Filter.setter
def Filter(self, value: str | None) -> None
Gets or sets the words the list is narrowed by, a wild-card pattern as the AutoCAD filter box takes it (WALL*, *-EXT,DOOR?); empty or * lists every layer.
Listed
@property
def Listed(self) -> System.Collections.Generic.IReadOnlyList[CadLayerWalkRow]
Gets the layers the filter lists, in the order of CadLayerWalkRequest.Rows.
Message
@property
def Message(self) -> str | None
Gets what the last change said where it was refused; null where it was made.
RestoreOnExit
@property
def RestoreOnExit(self) -> bool
@RestoreOnExit.setter
def RestoreOnExit(self, value: bool) -> None
Gets or sets whether closing the dialog puts the layers back as they were; true until set, as AutoCAD's Restore on exit.
Rows
@property
def Rows(self) -> System.Collections.Generic.IReadOnlyList[CadLayerWalkRow]
Gets every layer of the drawing, in ordinal order of the names, letters of either case alike.
Selected
@property
def Selected(self) -> System.Collections.Generic.IReadOnlyList[str]
Gets the names of the layers walked now; empty where every layer is as it was.
Methods
Purge
def Purge(
self,
names: System.Collections.Generic.IEnumerable[str],
) -> System.Collections.Generic.IReadOnlyList[str]
Purge Layers: deletes the layers named that nothing uses, as the dialog's menu does; a layer in use, the current layer, 0 and Defpoints are kept; a layer a viewport freezes is thawed there and deleted. Each layer is deleted on its own, so that one that is refused leaves the others deleted. A layer deleted leaves the list.
Restore
def Restore(self) -> bool
Puts every layer back as it was before the walk, as closing with Restore on exit does.
Walk
def Walk(self, names: System.Collections.Generic.IReadOnlyCollection[str]) -> bool
Walks layers: every layer but those named is turned off, those named turned on and thawed. A name no layer has is left out; none given shows every layer as it was.
WalkLayersOf
def WalkLayersOf(self, handles: System.Collections.Generic.IEnumerable[str]) -> bool
Select objects: walks the layers of the objects picked on the canvas, as AutoCAD's button selects them in the list.