Get Instance Extents (Python)

Get Instance Extents (Python)
 1# This example prints extent of all the 3D instance in all the 3D layers in the active drawing.
 2
 3for layer in impact.active_drawing.layers:
 4
 5    if layer.layer_type == "THREE_D":
 6        scene = layer.scene
 7
 8        if not scene.isNone():
 9
10            for instance in scene.instances:
11
12                # Gets the extent
13                r = instance.extents
14
15                # Prints the extent
16                impact.gui.output_toolbox.add(r.to_string())
17        else:
18
19            impact.gui.output_toolbox.add("No 3d scene")