Hi guys I was working on a script which was gonna work with physics rules to measure speed and Acceleration then I suddenly saw this trick for getting the distance I mean using Create>measure tools>distance tools in maya 3d viewport it shows the distance which I wanted to use my script to get that so now I think I can use this easier but if I can get the number which this tools writes on the viewport how can I get that number into my script? :curious:
Working on a script for measuring speed and Acceleration
kiryha
#2
distanceDimensionShape node has attribute “Distance” which output what you are looking for.
KMTHRONG
#3
TNx for reply I know that’s there I don’t know how to use it in my script I mean how?
$distance sth like this I want to use but what’s that sth.
BTW I found another way:
vector $obj1=getAttr pSphere1.translate;
vector $obj2=getAttr pSphere2.translate;
float $mag=mag($obj2-$obj1);
print $mag;
but if you can tell me how can I use distance it’s great.I always wanna now more 
kiryha
#4
In pymel (i guess there almost no reasons to learn MEL in year 2015)
import pymel.core as pm
dimension = pm.PyNode('distanceDimensionShape1')
print dimension.distance.get()
haggi
#5
The distance is an attribute and querying an attribute works the same way as you already used it to get the translation of the spheres.