How to prompt user to select node, and store its X,Y,Z locations
Hi,
I am writing a tcl script and I am trying to get the user to inform the script of where the script should be taking place. I want to request this by having the user select (pick) a node.
From this node I would want to retrieve the X,Y,Z locations of that node, and store them in a variable and proceed with the rest of the script.
How might I do this?
Thanks in advance for the help!
Tyler
Answers
-
Figured it out!
#Prompt user to pick node
*createmarkpanel nodes 1 'Please select Node'
set BNode [hm_getmark nodes 1]
set Z_Node [hm_getentityvalue NODE $BNode 'z' 0]0 -
Hi,
Note that 'z' data name is local coordinate
if you want to get root coordinate, use 'globalz' data name, or simply:
lassign [expr [hm_nodevalue $BNode]] X_Node Y_Node Z_Node
0