::GetCurrentSelectionNodeId
This command gets the node ID for the current selection that is set for the specified mdlTempCollector widget. If the node ID is unavailable or unknown, nothing is returned.
Syntax
::model::mdlTempCollector::GetCurrentSelectionNodeId path
Application
MotionView Tcl GUI
Description
This command gets the node ID for the current selection that is set for the specified mdlTempCollector widget. If the node ID is unavailable or unknown, nothing is returned.
Inputs
- path
- The full path of the mdlTempCollector widget that this procedure is being called for.
Example
With a model that contains at least one deformable body (they contain nodes) in the active
page and window, execute the following script. That script will create a dialog that will
contain an mdlTempCollector widget that is set to pick “Nodes” and display a message that
reports the id of the selected node. With that dialog displayed, activate the “Node”
collector that it contains and graphically pick a node from one of the deformable bodies in
your active
model:
namespace eval ::my_test {
variable my_node ""
}
set tl [toplevel .top]
wm geometry $tl 550x100
wm title $tl "::model::mdlTempCollector::GetCurrentSelectionNodeId Example"
grid rowconfigure $tl 2 -weight 1
grid columnconfigure $tl 0 -weight 1
set col [::model::mdlTempCollector $tl.col ::my_test::my_node "Node" "MeshNode" \
-afterResolveFunc ::my_test::onNodePicked]
grid $col -row 0 -column 0 -sticky nesw
proc ::my_test::onNodePicked {} {
set id [::model::mdlTempCollector::GetCurrentSelectionNodeId .top.col]
tk_messageBox -message "Picked node id: $id"
}
Errors
This procedure does not generate any errors, it returns nothing if the selection does not have an associated node ID.