hm_measureshortestdistance not working properly
All the brown color elems are 3d elements in the collector solidmap while the green color elems are 2d elems in collector auto1.
I execute the following command
*createmark elems 1 599
*createmark elems 2 'by comp name' auto1
hm_measureshortestdistance elems 1 0 elems 2 0 0
it returns-> 0 0 0 0 599 0 0 0 1 0 0 0
but as we can see the distance between elem id 599 and elem id 1 is not 0.and elem id 1 is not the nearest elem to 599 among all other elems of auto1.
Can somebody explain this ?
Find more posts tagged with
How about this:
*createmark nodes 1 'by elem' 599
*createmark nodes 2 'by comp name' auto1
set N2 [lindex [hm_measureshortestdistance nodes 1 0 nodes 2 0 0] end-3]
*createmark elems 1 'by node' $N2
puts 'closest elems: [hm_getmark elems 1]'
You can use hm_entityinfo centroid elems
to get centroid of e599 and the closest elems then compare which one is closer to e599 => decide that is closest.
I got the ans, elem is not a valid entity type for this type, the Valid values are nodes, points, lines, surfaces and solids.Apart from this is there any api which can do the task which I intend to do ?