How do I export the dimensions from the measure utility?
Preferably in MaxScript
Solved! Go to Solution.
Solved by leeminardi. Go to Solution.
If you want the distance between 2 points you can use the following in a Maxscript.
e1 = pickPoint prompt:"\nPick 1st point" snap:#3D
e2 = pickPoint prompt:"\nPick 2nd point" snap:#3D
vlen = length(e2-e1) -- vector length from vertex 1 to 2
xlen = dot (e2 - e1) ([1,0,0])
ylen = dot (e2 - e1) ([0,1,0])
zlen = dot (e2 - e1) ([0,0,1])
format "distance = %, dx = %, dy = %, dz = % \n" vlen xlen ylen zlen
Can you give an example of " the 'Dimensions' the measure tool calculates"? The Measure Tool on my copy of Max gives the distance between 2 points as well as dx, dy, and dz.
It is not clear what "rectangle" you refer to. E.g., what would be the rectangle for a teapot?
If you are looking for the bounding box coordinates you can use:
$objectname.max
$objectname.min
It looks like you want the dimensions of the object's bounding box not to be confused with the dimensions of the object. You can use the two points of the bounding box to get those three values.
And how do i get to the Bounding box's dimensions with MAXSCRIPT?
Thanks so much
There may be a more elegant method but this will give you the same output as Measure.
/* Determines the bounding box dimensions in world coordinates
of the select object lrm v1 10/10/201p */ obj = selection[1] w = (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]) bb = nodeGetBoundingBox obj w pmin = bb[1] pmax = bb[2] dx = pmax.x - pmin.x dy = pmax.y - pmin.y dz = pmax.z - pmin.z format "\ndelta x = %, delta y = %, delta z = %\n" dx dy dz
Can't find what you're looking for? Ask the community or share your knowledge.