::hwp::interactiveSelection

Interactive entity selection context that returns either an ID list or selection sets.

Syntax

::hwp::interactiveSelection

Application

Tcl Interactive Query

Description

Starts an interactive selection context with an entity selector to specify the entity type to select, such as nodes or elements. The return value can be either lists or selection sets of the selected entities. Like the idle mode selection, the advanced selection methods are supported.

Mandatory Arguments

None.

Optional Arguments

-entityType "Part/Node/Element"
Entity type of the selection context.
The default value is Part.
-modal "true/false"
Makes the interactive selection modal if true. Only graphical interaction is possible, like zooming and rotating the model.
The default value is true.
-mode "single/list/multiple"
Set the selection mode. Options include:
list
Allows you to select/create a list of sorted entities. “list” is the default.
multiple
Allows you to select multiple entities. It returns either a selection set or a dictionary-sorted list of IDs.
single
Allows you to select/return a single entity.
Note: The advanced selection is disabled in “list” and “single” mode.
-returnType "list/selectionset"
Defines the return type. Options include:
list
Returns an entity ID list. This is the default.
selectionset
Returns a selections set handle.
-selectionSetLabel "<set_label>"
Creates an entity set with the given label, which contains the selected entities.
Note: This only works if the option -returnType is set to selectionset.
-message "<customized_message>"
This message is displayed in the status bar on the lower left corner before the first entity is selected.

Returns

Returns either a list or a selection set with the selected IDs.

Examples

Selection context returns a part list:
set partList  [::hwp::interactiveSelection]
Selection context returns a part selection set handle:
set partSelectionSetHandle [::hwp::interactiveSelection -mode "multiple" -returnType "selectionset"]
Select a single node with modal turned off. A custom message is shown in the status bar:
set nodeId  [::hwp::interactiveSelection -entityType "Node" -modal false -mode "single"  -message "Select single Node"]
Select a sorted list by pressing the Ctrl key and display a custom message the status bar:
set sortedElementList  [::hwp::interactiveSelection -entityType "Element" -mode "list"  -message "Select Elements for sorted list"]
Selection context returns an element selection set handle and creates a selection set with the given label. A custom message is displayed in the status bar:
set elementSelectionSetHandle [::hwp::interactiveSelection -entityType "Element" -mode "multiple" -returnType "selectionset" -selectionSetLabel "My custom element set" -message "Select Elements for selection set"]