Table of Contents

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

.NET

@property
def Count(self) -> int

Gets the number of selected entities.

CurrentVertex

.NET

@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

.NET

@property
def Handles(self) -> System.Collections.Generic.IReadOnlyCollection[str]

Gets the handles of the selected entities.

Events

Changed

.NET

@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

.NET

def Add(self, handles: System.Collections.Generic.IEnumerable[str]) -> None

Selects entities, those already selected staying so.

Clear

.NET

def Clear(self) -> None

Selects nothing.

Contains

.NET

def Contains(self, handle: str) -> bool

Gets whether an entity is selected.

Remove

.NET

def Remove(self, handles: System.Collections.Generic.IEnumerable[str]) -> None

Takes entities out of the selection.

Set

.NET

def Set(self, handles: System.Collections.Generic.IEnumerable[str]) -> None

Makes the selection exactly these entities.

Toggle

.NET

def Toggle(self, handle: str) -> None

Selects an entity that is not selected and deselects one that is.