poIModel AddSelectionSet
Creates a new selection set on the current model.
Syntax
model_handle AddSelectionSettype
Application
HyperView Tcl Modify
Description
This command creates a new selection set of a particular type on the current model. Using the ID that is returned by this command, you can retrieve the handle to the newly created selection set and perform actions such as adding entities and setting the visibility on it.
Inputs
- type
- Type can be either node, element, part, system, or assembly.
Example
hwi OpenStack
hwi GetSessionHandle session_handle
session_handle GetProjectHandle project_handle
project_handle GetPageHandle page_handle [project_handle GetActivePage]
page_handle GetWindowHandle window_handle [page_handle GetActiveWindow]
window_handle GetClientHandle client_handle
client_handle GetModelHandle model_handle [client_handle GetActiveModel]
set id [model_handle AddSelectionSet component]
model_handle GetSelectionSetHandle selection_set_handle $id
selection_set_handle SetLabel "OurSelectionSet"
selection_set_handle Add all
selection_set_handle SetVisibility true
puts "Current selection set ID: [selection_set_handle GetID]"
puts " Label: [selection_set_handle GetLabel]"
puts " Size: [selection_set_handle GetSize] [selection_set_handle GetType]s"
puts "----------------------"
selection_set_handle ReleaseHandle
model_handle ChangeSelectionSetType $id elements
model_handle GetSelectionSetHandle selection_set_handle $id
puts "After type change------"
puts "Current selection set ID: [selection_set_handle GetID]"
puts " Label: [selection_set_handle GetLabel]"
puts " Size: [selection_set_handle GetSize] [selection_set_handle GetType]s"
puts "----------------------"
hwi CloseStack
Errors
Returns the ID of the selection set.