Selection Mixin¶
Entity selection by color, layer, or type; selection info and clipboard state.
adapters.mixins.selection_mixin.SelectionMixin
¶
Mixin for selection operations.
select_by_color
¶
Select all entities matching the given color and return their handles.
| PARAMETER | DESCRIPTION |
|---|---|
color
|
Color name (e.g.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List of entity handle strings for matching entities. |
select_by_layer
¶
Select all entities residing on the specified layer and return their handles.
| PARAMETER | DESCRIPTION |
|---|---|
layer_name
|
Exact layer name (case-insensitive comparison is used).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List of entity handle strings for entities on the given layer. |
select_by_type
¶
Select all entities of a given type and return their handles.
Accepts user-friendly names ("line", "circle", "arc",
"polyline", "text", "point") or raw AutoCAD ObjectName strings.
| PARAMETER | DESCRIPTION |
|---|---|
entity_type
|
Entity type name (user-friendly or AutoCAD ObjectName).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List of entity handle strings for matching entities. |
get_selected_entities
¶
Return handles of all currently selected entities via a temporary SelectionSet.
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List of entity handle strings. Empty list if nothing is selected or on error. |
clear_selection
¶
Deselect all currently selected entities in the active document.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if cleared successfully, False otherwise. |
has_selection
¶
Check if any entities are currently selected.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if at least one entity is selected, False otherwise |
get_selected_entity_handles
¶
Get list of currently selected entity handles.
| RETURNS | DESCRIPTION |
|---|---|
list[str]
|
List of entity handles (strings). Empty list if no selection. |
get_selection_info
¶
Get comprehensive information about current selection.
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Dictionary with: |
dict[str, Any]
|
|
dict[str, Any]
|
|
dict[str, Any]
|
|
dict[str, Any]
|
|