Posted By

joseamirandavelez on 06/09/12



Versions (?)

ANSYS single node picking

 / Published in: TCL

Functions for picking a single node in ANSYS and retrieving the node number.

This is more a hack, since it uses a predefined UIDL function designed for an ANSYS tool. It happens to be useful for picking a single node since it returns the node number as a variable in ANSYS which we can retrieve. You will need the code in the source:

Then you create a button and assign the pickSingleNode procedure to its command. Notice that the UIDL call in the pickSingleNode procedure receives the code inside getNodeNumber procedure as a parameter. The UIDL function will execute this code when its done. The getNodeNumber procedure retrieves the number of the picked node, which was saved in the ANSYS variable _Z1, and stores it in a variable.

The destination variable is pkNode in this case. You need to change this to the variable assigned to the destination widget, for example, an entry box.

  1. proc pickSingleNode {args} {
  2. uidl::callFnc Fnc_P26_N_p [namespace code getNodeNumber]
  3. }
  5. proc getNodeNumber {uidlButton } {
  6. if { $uidlButton == 1 } {
  7. # Cancel
  8. return
  9. }
  10. set pkNode [ans_getvalue PARM,_Z1,VALU]
  11. set ::FMWizard::node1 $pkNode
  12. }

Report this snippet  

You need to login to post a comment.