Change 3D Model Fold Ratio¶
Change 3D Model Fold Ratio¶
1# This example to change fold ratio of all the 3d models in all the 3d layers in the active drawing.
2
3for layer in impact.active_drawing.layers:
4 if layer.layer_type == "THREE_D":
5 scene = layer.scene
6
7 if scene is not None:
8 for instance in scene.instances:
9 object = instance.object()
10
11 if object is not None:
12 if object.type == ip3DObjectType.ot3DModel:
13 model = object
14 impact.gui.output_toolbox.add("Models fold ratio before:")
15 impact.gui.output_toolbox.add(model.fold_ratio)
16 model.fold_ratio = 0.5
17 impact.gui.output_toolbox.add("Models fold ratio after:")
18 impact.gui.output_toolbox.add(model.fold_ratio)
19
20 else:
21 impact.gui.output_toolbox.add("No 3d scene")