🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

How to prompt user to select node, and store its X,Y,Z locations

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

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 

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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]

    User: "tinh"
    Altair Community Member
    Updated by tinh

    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