I'm trying to get the dimensions (bounding box) from a linked object in python, but all the methods to commonly get the measures give me a zero vector.

# (0.0, 0.0, 0.0)

# ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))

I imagine is because the object is an empty, so it does not have dimension. I suppose there is a way to access the underlying information of the linked object but I cannot find a way to do it.

I have to keep the object linked, I cannot make a local copy because it can be modified in the source file.

Any Ideas how to do it?

Thank you.


1 Answer 1


For a linked collection instance

Pertaining to 2.8x

Example below. Collection instance "Cube.001" is linked from library "Cube.blend" where it belongs to collection "Cube"

>>> C.object

>>> C.object.type

>>> C.object.library

Notice the collection is linked too

>>> C.object.instance_collection

>>> D.collections['Cube'].objects[:]

The dimensions of the individual objects in the group can be found via

>>> for o in C.object.instance_collection.objects:
...     o.name, o.type, o.dimensions
('Cube', 'MESH', Vector((2.0000009536743164, 2.0000009536743164, 2.0)))

which could be used to make a "virtual" bounding box for the collection.

How to have a boundary box around a whole group instance?

Similarly for linking the collection and instancing from local blend.

  • 1
    $\begingroup$ Thank you very much! Just if there is someone with my low bpy skills: C = bpy.context and D = bpy.data (took me more than I'd like to admit). $\endgroup$ Jan 10, 2020 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .