Community
3ds Max Modeling
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max modeling topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Measure Utility

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Anonymous
1310 Views, 8 Replies

Measure Utility

How do I export the dimensions from the measure utility?

Preferably in MaxScript

8 REPLIES 8
Message 2 of 9
leeminardi
in reply to: Anonymous

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
lee.minardi
Message 3 of 9
Anonymous
in reply to: leeminardi

I don't need distance between 2 points, I need to export the 'Dimensions'
the measure tool calculates (a rectangle for any shape) to a variable via
maxscript
Message 4 of 9
leeminardi
in reply to: Anonymous

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

lee.minardi
Message 5 of 9
Anonymous
in reply to: leeminardi

I attached an example to this comment

Message 6 of 9
leeminardi
in reply to: Anonymous

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.

lee.minardi
Message 7 of 9
Anonymous
in reply to: leeminardi

And how do i get to the Bounding box's dimensions with MAXSCRIPT?

 

Thanks so much

Message 8 of 9
leeminardi
in reply to: Anonymous

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
lee.minardi
Message 9 of 9
Anonymous
in reply to: leeminardi

Works like a charm! Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report