How to get object dimensions using python

Anonymous

How to get object dimensions using python

Anonymous
Not applicable

Hello,

I just try to get object dimensions using python code

max01.PNG 

 

I don't know how to get that x, y, z after access Inode..

 

Should I access Object thru Inode? but Object doesn't have dimentions property.. (https://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__py_ref_class_max_plus_1_1_object_html)

(GetObject, GetBaseObject, GetObjectRef which one can access to get dimensions?)

 

Thanks.

 

 

 

0 Likes
Reply
Accepted solutions (1)
993 Views
1 Reply
Reply (1)

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

because for modern versions of 3DS MAX only pymxs is available, the dimension can be obtained as:

 

import pymxs
rt = pymxs.runtime
n = rt.selection[0]
#local:
bb = rt.nodeLocalBoundingBox(n) 
bb[1] - bb[0]
#or world:
n.max - n.min