--- /dev/null
+
+ .. _tui_create_common:
+
+Create Common
+=============
+
+.. literalinclude:: examples/common.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/common.py>`
+
--- /dev/null
+
+ .. _tui_create_cut:
+
+Create Cut
+==========
+
+.. literalinclude:: examples/cut.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/cut.py>`
+
--- /dev/null
+
+ .. _tui_create_fill:
+
+Create Fill
+===========
+
+.. literalinclude:: examples/fill.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/fill.py>`
+
--- /dev/null
+
+ .. _tui_create_fuse:
+
+Create Fuse
+===========
+
+.. literalinclude:: examples/fuse.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/fuse.py>`
+
--- /dev/null
+
+ .. _tui_create_intersection:
+
+Create Intersection
+===================
+
+.. literalinclude:: examples/intersection.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/intersection.py>`
+
--- /dev/null
+
+ .. _tui_create_partition:
+
+Create Partition
+================
+
+.. literalinclude:: examples/partition.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/partition.py>`
+
--- /dev/null
+
+ .. _tui_create_placement:
+
+Create Placement
+================
+
+.. literalinclude:: examples/placement.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/placement.py>`
+
--- /dev/null
+
+ .. _tui_create_smash:
+
+Create Smash
+============
+
+.. literalinclude:: examples/smash.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/smash.py>`
+
--- /dev/null
+
+ .. _tui_create_union:
+
+Create Union
+============
+
+.. literalinclude:: examples/union.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/union.py>`
+
Common
======
+To a create boolean opration Common in the active part:
+#. select in the Main Menu *Features - > Common* item or
+#. click **Common** button in the toolbar
+
+.. image:: images/common_btn.png
+ :align: center
+
+.. centered::
+ **Common** button
+
+The following property panel will be opened:
+
.. image:: images/Common.png
:align: center
.. centered::
- Common definition
+ **Common operation**
+
+It is necessary to select main objects and tool objects.
+
+**Apply** button creates the common shape.
+
+**Cancel** button cancels operation.
+
+**TUI Command**: *model.addCommon(Part_doc, mainObjects, toolObjects)*
+
+**Arguments**: Part + list of main objects + list of tool objects.
+
+The Result of the operation will be a shape which is a common for all selected shapes:
+
+.. image:: images/CreatedCommon.png
+ :align: center
+
+.. centered::
+ **Common created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_common` operation.
Cut
===
+To a create boolean opration Cut in the active part:
+
+#. select in the Main Menu *Features - > Cut* item or
+#. click **Cut** button in the toolbar
+
+.. image:: images/bool_cut.png
+ :align: center
+
+.. centered::
+ **Cut** button
+
+The following property panel will be opened:
.. image:: images/Cut.png
:align: center
.. centered::
- Cut definition
+ **Cut operation**
+
+Here it is necessary to select main objects and tool objects.
+
+**Apply** button creates the cut shape.
+
+**Cancel** button cancels operation.
+
+**TUI Command**: *model.addCut(Part_doc, mainObjects, toolObjects)*
+
+**Arguments**: Part + list of main objects + list of tool objects.
+
+The Result of the operation will be a shape which is a cut of tool objects from main objects:
+
+.. image:: images/CreatedCut.png
+ :align: center
+
+.. centered::
+ **Cut created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_cut` operation.
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc,
+ model.selection("VERTEX", "PartSet/Origin"),
+ model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Common_1 = model.addCommon(Part_1_doc,
+ [model.selection("SOLID", "Cylinder_1_1")],
+ [model.selection("SOLID", "Box_1_1")])
+model.do()
+model.end()
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc,
+ model.selection("VERTEX", "PartSet/Origin"),
+ model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Cut_1 = model.addCut(Part_1_doc,
+ [model.selection("SOLID", "Cylinder_1_1")],
+ [model.selection("SOLID", "Box_1_1")])
+model.do()
+model.end()
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc,
+ model.selection("VERTEX", "PartSet/Origin"),
+ model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Fill_1 = model.addFill(Part_1_doc,
+ [model.selection("SOLID", "Cylinder_1_1")],
+ [model.selection("SOLID", "Box_1_1")])
+model.do()
+model.end()
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc,
+ model.selection("VERTEX", "PartSet/Origin"),
+ model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Fuse_1 = model.addFuse(Part_1_doc,
+ [model.selection("SOLID", "Cylinder_1_1")],
+ [model.selection("SOLID", "Box_1_1")])
+model.do()
+model.end()
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc,
+ model.selection("VERTEX", "PartSet/Origin"),
+ model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Intersection_1 = model.addIntersection(Part_1_doc,
+ [model.selection("SOLID", "Cylinder_1_1"),
+ model.selection("SOLID", "Box_1_1")])
+model.do()
+model.end()
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc,
+ model.selection("VERTEX", "PartSet/Origin"),
+ model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Partition_1 = model.addPartition(Part_1_doc,
+ [model.selection("SOLID", "Cylinder_1_1"), model.selection("SOLID", "Box_1_1")])
+model.do()
+model.end()
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
+SketchCircle_1 = Sketch_1.addCircle(20, 6, 3)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc,
+ [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")],
+ model.selection(), -10, 0)
+Placement_1 = model.addPlacement(Part_1_doc,
+ [model.selection("SOLID", "Extrusion_1_1")],
+ model.selection("FACE", "Extrusion_1_1/From_Face_1"),
+ model.selection("FACE", "Box_1_1/Front"), False, True)
+model.do()
+model.end()
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc,
+ model.selection("VERTEX", "PartSet/Origin"),
+ model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Smash_1 = model.addSmash(Part_1_doc,
+ [model.selection("SOLID", "Cylinder_1_1")],
+ [model.selection("SOLID", "Box_1_1")])
+model.do()
+model.end()
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(71, -15, -32, -15)
+SketchLine_2 = Sketch_1.addLine(-32, -15, -32, -56)
+SketchLine_3 = Sketch_1.addLine(-32, -56, 71, -56)
+SketchLine_4 = Sketch_1.addLine(71, -56, 71, -15)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(3, -15, 36, -56)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_1.result())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_3.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc,
+ [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_5r"),
+ model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f")],
+ model.selection(), 10, 0)
+Union_1 = model.addUnion(Part_1_doc,
+ [model.selection("SOLID", "Extrusion_1_1_1"),
+ model.selection("SOLID", "Extrusion_1_1_2")])
+model.do()
+model.end()
Fill
====
+To a create boolean opration Fill in the active part:
+
+#. select in the Main Menu *Features - > Fill* item or
+#. click **Fill** button in the toolbar
+
+.. image:: images/bool_fill.png
+ :align: center
+
+.. centered::
+ **Fill** button
+
+The following property panel will be opened:
.. image:: images/Fill.png
:align: center
.. centered::
- Fill definition
+ **Fill operation**
+
+Here it is necessary to select main objects and tool objects.
+
+**Apply** button creates the fill shape.
+
+**Cancel** button cancels operation.
+
+**TUI Command**: *model.addFill(Part_doc, mainObjects, toolObjects)*
+
+**Arguments**: Part + list of main objects + list of tool objects.
+
+The Result of the operation will be a shape which is a fill of tool objects with main objects:
+
+.. image:: images/CreatedFill.png
+ :align: center
+
+.. centered::
+ **Fill created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_fill` operation.
Fuse
====
+To a create boolean opration Fuse in the active part:
+
+#. select in the Main Menu *Features - > Fuse* item or
+#. click **Fuse** button in the toolbar
+
+.. image:: images/bool_fuse.png
+ :align: center
+
+.. centered::
+ **Fuse** button
+
+The following property panel will be opened:
.. image:: images/Fuse.png
:align: center
.. centered::
- Fuse definition
+ **Fuse operation**
+
+Here it is necessary to select main objects and tool objects.
+
+**Apply** button creates the fuse shape.
+
+**Cancel** button cancels operation.
+
+**TUI Command**: *model.addFuse(Part_doc, mainObjects, toolObjects)*
+
+**Arguments**: Part + list of main objects + list of tool objects.
+
+The Result of the operation will be a shape which is a fuse of tool objects with main objects:
+
+.. image:: images/CreatedFuse.png
+ :align: center
+
+.. centered::
+ **Fuse created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_fuse` operation.
Intersection
============
+To a create boolean opration Intersection in the active part:
+
+#. select in the Main Menu *Features - > Intersection* item or
+#. click **Intersection** button in the toolbar
+
+.. image:: images/intersection_btn.png
+ :align: center
+
+.. centered::
+ **Intersection** button
+
+The following property panel will be opened:
.. image:: images/Intersection.png
:align: center
.. centered::
- Intersection definition
+ **Intersection operation**
+
+Here it is necessary to select some objects.
+
+**Apply** button creates the intersection shape.
+
+**Cancel** button cancels operation.
+
+**TUI Command**: *model.addIntersection(Part_doc, Objects)*
+
+**Arguments**: Part + list of objects.
+
+The Result of the operation will be a shape which is an intersection of selected objects:
+
+.. image:: images/CreatedIntersection.png
+ :align: center
+
+.. centered::
+ **Intersection created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_intersection` operation.
Partition
=========
+To a create boolean opration Partition in the active part:
+
+#. select in the Main Menu *Features - > Partition* item or
+#. click **Partition** button in the toolbar
+
+.. image:: images/partition_btn.png
+ :align: center
+
+.. centered::
+ **Partition** button
+
+The following property panel will be opened:
.. image:: images/Partition.png
:align: center
.. centered::
- Partition definition
+ **Partition operation**
+
+Here it is necessary to select several objects.
+
+**Apply** button creates the partition shape.
+
+**Cancel** button cancels operation.
+
+**TUI Command**: *model.addPartition(Part_doc, objects)*
+
+**Arguments**: Part + list of objects.
+
+The Result of the operation will be a shape which is a partition of selected objects:
+
+.. image:: images/CreatedPartition.png
+ :align: center
+
+.. centered::
+ **Partition created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_partition` operation.
Placement
=========
+Placement lets to place a one object relatively to another object. To make a placement:
+
+#. select in the Main Menu *Part - > Placement* item or
+#. click **Placement** button in the toolbar
+
+.. image:: images/placement_btn.png
+ :align: center
+
+.. centered::
+ **Placement** button
+
+The following property panel will be opened:
.. image:: images/Placement.png
:align: center
.. centered::
- Placement definition
+ **Placement operation**
+
+In this property panel it is necessary:
+- Select objects which will be moved.
+- Select a face, edge or vertex as a start for moving
+- Select a face, edge or vertex as an end of moving
+- Define state of **Reverse** and **Centering** check boxes.
+
+
+**Apply** button creates the placement.
+
+**Cancel** button cancels the operation.
+
+**TUI Command**: *model.addPlacement(Part_doc, placeObjects, startShape, endShape, isReverse, isCentering)*
+
+**Arguments**: Part + list of objects to move + start shape + end shape + is reverse flag + is centering flag.
+
+The Result of the operation will be a new placement of selected objects:
+
+.. image:: images/CreatedPlacement.png
+ :align: center
+
+.. centered::
+ **Placement created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_placement` operation.
Smash
=====
+To a create boolean opration Smash in the active part:
+
+#. select in the Main Menu *Features - > Smash* item or
+#. click **Smash** button in the toolbar
+
+.. image:: images/bool_smash.png
+ :align: center
+
+.. centered::
+ **Smash** button
+
+The following property panel will be opened:
.. image:: images/Smash.png
:align: center
.. centered::
- Smash definition
+ **Smash operation**
+
+Here it is necessary to select main objects and tool objects.
+
+**Apply** button creates the smash shape.
+
+**Cancel** button cancels operation.
+
+**TUI Command**: *model.addSmash(Part_doc, mainObjects, toolObjects)*
+
+**Arguments**: Part + list of main objects + list of tool objects.
+
+The Result of the operation will be a shape which is a smash of tool objects from main objects:
+
+.. image:: images/CreatedSmash.png
+ :align: center
+
+.. centered::
+ **Smash created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_smash` operation.
Union
=====
+To a create boolean opration Union in the active part:
+
+#. select in the Main Menu *Features - > Union* item or
+#. click **Union** button in the toolbar
+
+.. image:: images/union_btn.png
+ :align: center
+
+.. centered::
+ **Union** button
+
+The following property panel will be opened:
.. image:: images/Union.png
:align: center
.. centered::
- Union definition
+ **Union operation**
+
+Here it is necessary to select some objects.
+
+**Apply** button creates the union shape.
+
+**Cancel** button cancels operation.
+
+**TUI Command**: *model.addUnion(Part_doc, objects)*
+
+**Arguments**: Part + list of objects.
+
+The Result of the operation will be a shape which is a union of selected objects:
+
+.. image:: images/CreatedUnion.png
+ :align: center
+
+.. centered::
+ **Union created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_union` operation.