Example (Python)

Example (Python)
 1# This example to change thickness of all the 3d models 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                object = instance.object()
12
13                if not object.isNone():
14
15                    if object.type == ip3DObjectType.ot3DModel:
16                        model = object
17                        impact.gui.output_toolbox.add("Models thickness before:")
18                        impact.gui.output_toolbox.add(model.thickness)
19                        model.thickness = 3
20                        impact.gui.output_toolbox.add("Models thickness after:")
21                        impact.gui.output_toolbox.add(model.thickness)
22
23        else:
24
25            impact.gui.output_toolbox.add("No 3d scene")