CadSelection
from OpenCAD2D import CadSelection
class CadSelection(System.Object) ยท CadSelection in the .NET reference
The entities that have been selected, by handle. An entity is picked and selected as a whole: all the display items it was drawn as are selected with it.
Constructors
__init__
def __init__(self) -> None
Properties and fields
Count
@property
def Count(self) -> int
Gets the number of selected entities.
CurrentVertex
@property
def CurrentVertex(self) -> int
@CurrentVertex.setter
def CurrentVertex(self, value: int) -> None
Gets or sets the vertex of a selected polyline the Properties panel shows, counted from 1, as the Current vertex row of AutoCAD's palette steps through them; back to 1 whenever the set of selected handles changes. A polyline of 4 vertices at 9 shows its fourth.
Handles
@property
def Handles(self) -> System.Collections.Generic.IReadOnlyCollection[str]
Gets the handles of the selected entities.
Events
Changed
@property
def Changed(self) -> System.EventHandler[System.EventArgs]
@Changed.setter
def Changed(self, value: System.EventHandler[System.EventArgs]) -> None
Raised when the set of selected handles changes, or the vertex Properties shows (CadSelection.CurrentVertex).
Methods
Add
def Add(self, handles: System.Collections.Generic.IEnumerable[str]) -> None
Selects entities, those already selected staying so.
Clear
def Clear(self) -> None
Selects nothing.
Contains
def Contains(self, handle: str) -> bool
Gets whether an entity is selected.
Remove
def Remove(self, handles: System.Collections.Generic.IEnumerable[str]) -> None
Takes entities out of the selection.
Set
def Set(self, handles: System.Collections.Generic.IEnumerable[str]) -> None
Makes the selection exactly these entities.
Toggle
def Toggle(self, handle: str) -> None
Selects an entity that is not selected and deselects one that is.