Jump to content

"hm_getdistance nodes" refere to single values

Recommended Posts

Hello at all,


My Problem:

  • have got two nodes (node 1 and node 2)          --> node 1 is the reference for current position; node 2 is the reference for target position
  • when using hm_getdistance nodes 1 2 0 ,

i get the following answer:

573.68267674323      495.66721    3.8981341703782e-014       288.8353

total distance              x-distance     y-distance                             z-distance


I´ll put the values for total distance and x-, y-, z-distances in a subsequent command for translate a hole component from node1 to node 2.

Therefore i need to create a vector with

*createvector 1 $x $y $z

*translatemark components 1 1 $total_distance 1


How can i get access or refer to the single values?


Thanks for your help :)



My latest try:

*createmark components 1 "displayed"
*createmarkpanel nodes 1 "choose node 1"
*createmark nodes 1
*createmarkpanel nodes 2 "choose node 2"
*createmark nodes 2
set xVal [hm_getdistance nodes 1 2 dataname=x]
set yVal [hm_getdistance nodes 1 2 dataname=y]
set zVal [hm_getdistance nodes 1 2 dataname=z]
set totVal [hm_getdistance nodes 1 2 dataname=tot]
*createvector 1 $xVal $yVal $zVal
*translatemark components 1 1 $totVal

the problem is the "dataname="

Share this post

Link to post
Share on other sites

Hi Rizzo,


You can do this using foreach:

*createmark components 1 "displayed"
*createmarkpanel nodes 1 "node1"
set node1 [hm_getmark nodes 1]
*clearmark nodes 1

*createmarkpanel nodes 1 "node2"
set node2 [hm_getmark nodes 1]
*clearmark nodes 1

foreach {tot x y z} [hm_getdistance nodes $node1 $node2 0] { 
	*createvector 1 $x $y $z
	*translatemark components 1 1 $tot



Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...