Notifications
Clear all

[Closed] Getting Xref Bounding box values

Hi Brains trust

In this example I have a Xref box thats somewhere in world space other than 0,0,0 . How can I get some coordinates for the bounding values and the coordinates for the bounds centre. Is there even a way to get this data from an object thats an xref. ?

B

4 Replies
2 Replies
(@gandhics)
Joined: 11 months ago

Posts: 0

It is ObjectXref or SceneXref?

(@denist)
Joined: 11 months ago

Posts: 0

so what you have to do:

get xrefscene


s = xrefs.getxreffile 1

get xref scene root node


r = s.tree

get the bbox


r.children.min
r.children.max
r.children.center

it works because r.children is a node collection which caches bbox info and has related properties (same as selection, objects, etc.)

Its a Xref scene currently. Does that make a difference ? .

b

YES. I know this is a few years too late, but this is the top found item on google and has no answer.

You can easy ‘see’ the objects in an Xref scene by getting the xref scene and looking at it’s tree.children

chkXref = xrefs.getXRefFile 1
chkXrefRoot = chkXref.tree.children
chkXrefBounds = [ chkXrefRoot.min.x, chkXrefRoot.min.y, chkXrefRoot.max.x. chkXrefRoot.max.y ]

You can also change children position values . Know that all these will be lost when it’s reloaded.

chkXref.tree.children[1].position.x = 0

http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=files/GUID-090B28AB-5710-45BB-B324-8B6FD131A3C8.htm,topicNumber=d30e361862