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.
proc pickSingleNode {args} { uidl::callFnc Fnc_P26_N_p [namespace code getNodeNumber] } proc getNodeNumber {uidlButton } { if { $uidlButton == 1 } { # Cancel return } set pkNode [ans_getvalue PARM,_Z1,VALU] set ::FMWizard::node1 $pkNode }
You need to login to post a comment.
