]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2833: Update example scripts
authorvsv <vsv@opencascade.com>
Mon, 14 Jan 2019 15:46:25 +0000 (18:46 +0300)
committervsv <vsv@opencascade.com>
Mon, 14 Jan 2019 15:46:25 +0000 (18:46 +0300)
32 files changed:
src/BuildPlugin/doc/examples/compound.py
src/BuildPlugin/doc/examples/edge.py
src/BuildPlugin/doc/examples/filling.py
src/BuildPlugin/doc/examples/interpolation.py
src/BuildPlugin/doc/examples/polyline.py
src/BuildPlugin/doc/examples/vertex.py
src/BuildPlugin/doc/examples/wire.py
src/CollectionPlugin/doc/examoles/field.py [deleted file]
src/CollectionPlugin/doc/examoles/group.py [deleted file]
src/CollectionPlugin/doc/examples/field.py [new file with mode: 0644]
src/CollectionPlugin/doc/examples/group.py [new file with mode: 0644]
src/ConstructionPlugin/doc/examples/plane1.py
src/ConstructionPlugin/doc/examples/plane2.py
src/ConstructionPlugin/doc/examples/point2.py
src/ConstructionPlugin/doc/examples/point4.py
src/FeaturesPlugin/doc/examples/fillet1.py
src/FeaturesPlugin/doc/examples/fillet2.py
src/FeaturesPlugin/doc/examples/fuse_faces.py
src/FeaturesPlugin/doc/examples/pipe_binormal.py
src/FeaturesPlugin/doc/examples/pipe_locations.py
src/FeaturesPlugin/doc/examples/pipe_simple.py
src/FeaturesPlugin/doc/examples/placement.py
src/FeaturesPlugin/doc/examples/revolution_cut_by_angles.py
src/FeaturesPlugin/doc/examples/revolution_cut_by_bounding_planes.py
src/FeaturesPlugin/doc/examples/revolution_fuse_by_angles.py
src/FeaturesPlugin/doc/examples/revolution_fuse_by_bounding_planes.py
src/FeaturesPlugin/doc/examples/rotation2.py
src/FeaturesPlugin/doc/examples/symmetryaxis.py
src/FeaturesPlugin/doc/examples/translation2points.py
src/FeaturesPlugin/doc/examples/translationvector.py
src/FeaturesPlugin/doc/examples/union.py
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp

index 0394678d586706a6445eefcd8467adbe60fe4c43..ef01e11f3158cfe76c9746b612663927d9d997be 100644 (file)
@@ -7,10 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Compound_1_objects = [model.selection("FACE", "Box_1_1/Front"),
-                      model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top"),
-                      model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"),
-                      model.selection("EDGE", "Box_1_1/Back&Box_1_1/Top")]
+Compound_1_objects = [model.selection("FACE", "Box_1_1/Front"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Left")]
 Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
 model.do()
 model.end()
index 38f0254684b4283a32570a05d50320b2d30b7c42..24dccbb20da30b9e3e2f91efbd0c2adc62e36062 100644 (file)
@@ -7,9 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Edge_1_objects = [model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Front&Box_1_1/Left")]
-Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]")])
 model.do()
 model.end()
index d912bd38746969f52e096ce033ac53871d38ad40..b95a1ec1d1806585fa7a36db309d49e055417d6c 100644 (file)
@@ -7,8 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Edges = [model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top"),
-         model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top")]
-Filling_1 = model.addFilling(Part_1_doc, Edges)
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]")])
 model.do()
 model.end()
index be911ea9465266d957398093faa4ff6136c56058..9001d465f7e46f0ec62dc8a7b463c04e4a93a752 100644 (file)
@@ -7,10 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Interpolation_1_objects = [model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top"),
-                           model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"),
-                           model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Top"),
-                           model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top")]
+Interpolation_1_objects = [model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]")]
 Interpolation_1 = model.addInterpolation(Part_1_doc, Interpolation_1_objects, True, False)
 model.do()
 model.end()
index 9596db81130e3a6d2af6b64dead4f1a4dd820dca..4f54f0123741de4a34bcb5808736d02ec3427377 100644 (file)
@@ -9,7 +9,7 @@ Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Point_2 = model.addPoint(Part_1_doc, -10, -5, -7)
 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")])
-Polyline_1_objects = [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Bottom")]
+Polyline_1_objects = [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]")]
 Polyline_1 = model.addPolyline3D(Part_1_doc, Polyline_1_objects, False)
 model.do()
 model.end()
index ea2979b7fc61956975c072e5bd72d27940177703..2b0c5ce657c2a91bec4090ab0b98febdd8d7efbd 100644 (file)
@@ -7,11 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Vertex_1_objects = [model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top"),
-                    model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Top"),
-                    model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"),
-                    model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom"),
-                    model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Bottom")]
+Vertex_1_objects = [model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]")]
 Vertex_1 = model.addVertex(Part_1_doc, Vertex_1_objects)
 model.do()
 model.end()
index 36497d8fff4b5a7e7fd5b5f7b053828bd543c75e..47925a3e1d1aaadc3858e48207320eaf4d3cb0d7 100644 (file)
@@ -7,10 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Wire_1_objects = [model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Right&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Back&Box_1_1/Top")]
+Wire_1_objects = [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]")]
 Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
 model.do()
 model.end()
diff --git a/src/CollectionPlugin/doc/examoles/field.py b/src/CollectionPlugin/doc/examoles/field.py
deleted file mode 100644 (file)
index f0d917a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- 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)
-Field_1 = model.addField(Part_1_doc, 2, "DOUBLE", 2, ["DX", "DY"], [model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Top")])
-Field_1.addStep(0, 0, [[0.1, 0.2], [2.1, 1.7], [3.7, 1.95]])
-Field_1.addStep(1, 31, [[0.1, 0.2], [1.1, 2.1], [0.75, 3.1]])
-model.do()
-model.end()
diff --git a/src/CollectionPlugin/doc/examoles/group.py b/src/CollectionPlugin/doc/examoles/group.py
deleted file mode 100644 (file)
index 5c42ca4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from salome.shaper import model
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Cone_1_1/Face_1&Cone_1_1/Face_2"), model.selection("EDGE", "Cone_1_1/Face_1")])
-Group_1.setName("edges_cone")
-Group_1.result().setName("edges_cone")
-model.do()
-model.end()
diff --git a/src/CollectionPlugin/doc/examples/field.py b/src/CollectionPlugin/doc/examples/field.py
new file mode 100644 (file)
index 0000000..6ba1b0a
--- /dev/null
@@ -0,0 +1,15 @@
+# -*- 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)
+Field_1_objects = [model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Front")]
+Field_1 = model.addField(Part_1_doc, 2, "DOUBLE", 2, ["Comp 1", "Comp 2"], Field_1_objects)
+Field_1.addStep(0, 0, [[0, 0], [0.1, 0.2], [2.1, 1.7], [3.7, 1.95]])
+Field_1.addStep(1, 0, [[0, 0], [0.1, 0.2], [1.1, 2.1], [0.75, 3.1]])
+model.do()
+model.end()
diff --git a/src/CollectionPlugin/doc/examples/group.py b/src/CollectionPlugin/doc/examples/group.py
new file mode 100644 (file)
index 0000000..c66c5b1
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "[Cone_1_1/Face_1][Cone_1_1/Face_2]"), model.selection("EDGE", "[Cone_1_1/Face_1][Cone_1_1/Face_3]")])
+Group_1.result().setName("edges_cone")
+model.do()
+model.end()
index 576189911de01acfb8d59d591fa5fc731dc3bb7f..416292fdd8ff7965346894d50f76b63560b6e2af 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom"))
+Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"))
 model.do()
 model.end()
index fe351d87e18d2be2d8f5b3b5c1a2fe4b382f24f7..6e5475625551dc1e051fa5f0946ccc20708aa06f 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"), False)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]"), False)
 model.do()
 model.end()
index 41fa8768c0616944bd4c68f308b9b4a3cd580594..f73127ca597a7aeb1a92f8e009908e90d0fdc305 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "Box_1_1/Front&Box_1_1/Left"), 0.4, True, False)
+Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), 0.4, True, False)
 model.do()
 model.end()
index 0d28192273391ee112cb2727e414212ac990f34f..88e2cc32ac827040ade839ae57257b0821487168 100644 (file)
@@ -7,8 +7,8 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"))
-Axis_5 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Bottom"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"))
+Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"))
+Axis_5 = model.addAxis(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"))
 Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("EDGE", "Axis_2"))
 model.do()
 model.end()
index 67299d876884edde815d29669c2c0af033bc15c1..80cce185bc3087e5ac187b47363ebbf0490f38b1 100644 (file)
@@ -7,6 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Fillet_1 = model.addFillet(Part_1_doc, [model.selection("FACE", "Box_1_1/Front"), model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top")], 2)
+Fillet_1_objects = [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]")]
+Fillet_1 = model.addFillet(Part_1_doc, Fillet_1_objects, 2)
 model.do()
 model.end()
index a72a7ec7833739b29b6e1a1713e77502bfc81e73..465fbcd9d48e28888c74f70bfb49b8be93db86c0 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top")], 1, 3)
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")], 1, 3)
 model.do()
 model.end()
index 888480992648a7a976f3d74976fdabbec9c00e2a..ed41166ea18d0c10f16c4fdf1d1b8f7c21d42907 100644 (file)
@@ -33,10 +33,9 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result())
 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 50, 0)
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_7r-SketchLine_8f")], model.selection(), 0, 50)
-Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_8f-SketchLine_7r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_1r_wire")], model.selection(), 50, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 0, 50)
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")model.selection("SOLID", "Extrusion_2_1")])
 FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", "Fuse_1_1"))
-Export_1 = model.exportToXAO(Part_1_doc, '/tmp/shaper_gjzkis0q.xao', 'automatic_shaper_export_to_XAO')
 model.do()
 model.end()
index 68fc2bca4e51db5b96959ddff7c58c1a4e5f95f4..93bb0ce86548719bd3407586a3aa73cd61050974 100644 (file)
@@ -8,13 +8,9 @@ Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchLine_1 = Sketch_1.addLine(72.2418524871355, 29.96679215537161, -69.82505995666611, 29.96679215537161)
-SketchLine_1.result().setColor(225, 0, 0)
 SketchLine_2 = Sketch_1.addLine(-69.82505995666611, 29.96679215537161, -69.82505995666611, -40.02291624943114)
-SketchLine_2.result().setColor(225, 0, 0)
 SketchLine_3 = Sketch_1.addLine(-69.82505995666611, -40.02291624943114, 72.2418524871355, -40.02291624943114)
-SketchLine_3.result().setColor(225, 0, 0)
 SketchLine_4 = Sketch_1.addLine(72.2418524871355, -40.02291624943114, 72.2418524871355, 29.96679215537161)
-SketchLine_4.result().setColor(225, 0, 0)
 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())
@@ -28,7 +24,6 @@ Point_2 = model.addPoint(Part_1_doc, 0, 100, 40)
 Point_3 = model.addPoint(Part_1_doc, 0, 260, 60)
 Interpolation_1_objects = [model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")]
 Interpolation_1 = model.addInterpolation(Part_1_doc, Interpolation_1_objects, False, False)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
-Pipe_1 = model.addPipe(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Interpolation_1_1"), model.selection("EDGE", "PartSet/OX"))
+Pipe_1 = model.addPipe(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Interpolation_1_1"), model.selection("EDGE", "PartSet/OX"))
 model.do()
 model.end()
index 52386bd1b10bb46e1cb3909ed9949b6dbfce599b..33151313697e72df7528246fa68dd5857629f15e 100644 (file)
@@ -20,13 +20,13 @@ model.do()
 Sketch_3 = model.addSketch(Part_2_doc, model.selection("FACE", "Plane_2"))
 SketchCircle_3 = Sketch_3.addCircle(121.2811188302094, -19.85285601110755, 120.5601403551194)
 model.do()
-Interpolation_1_objects = [model.selection("VERTEX", "Sketch_1/Vertex-SketchCircle_1"), model.selection("VERTEX", "Sketch_2/Vertex-SketchCircle_2"), model.selection("VERTEX", "Sketch_3/Vertex-SketchCircle_3")]
+Interpolation_1_objects = [model.selection("VERTEX", "Sketch_1/SketchCircle_1"), model.selection("VERTEX", "Sketch_2/SketchCircle_2"), model.selection("VERTEX", "Sketch_3/SketchCircle_3")]
 Interpolation_1 = model.addInterpolation(Part_2_doc, Interpolation_1_objects, False, False)
-Vertex_1 = model.addVertex(Part_2_doc, [model.selection("VERTEX", "Sketch_2/Vertex-SketchCircle_2")])
+Vertex_1 = model.addVertex(Part_2_doc, [model.selection("VERTEX", "Sketch_2/SketchCircle_2")])
 Partition_1 = model.addPartition(Part_2_doc, [model.selection("EDGE", "Interpolation_1_1"), model.selection("VERTEX", "Vertex_1_1")])
 Wire_1 = model.addWire(Part_2_doc, [model.selection("EDGE", "Partition_1_1_1"), model.selection("EDGE", "Partition_1_1_2")])
-Pipe_1_objects_2 = [model.selection("VERTEX", "Interpolation_1_1/Vertex_1"), model.selection("VERTEX", "Vertex_1_1/Vertex_1_1_1"), model.selection("VERTEX", "Interpolation_1_1/Vertex_2")]
-Pipe_1_objects_1 = [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2f")]
+Pipe_1_objects_2 = [model.selection("VERTEX", "Interpolation_1_1/Vertex_1_2"), model.selection("VERTEX", "Interpolation_1_1/Vertex_1_1"), model.selection("VERTEX", "Vertex_1_1/Vertex_1_1&Sketch_2/SketchCircle_2")]
+Pipe_1_objects_1 = [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_2_2r_wire"), model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2r")]
 Pipe_1 = model.addPipe(Part_2_doc, Pipe_1_objects_1, model.selection("WIRE", "Wire_1_1"), Pipe_1_objects_2)
 model.do()
 model.end()
index 5deb47e2cd879189af9339e7cb48b5a042b4e496..05be8a2834eade992188aff402526e63dbe51f62 100644 (file)
@@ -11,25 +11,19 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
-SketchPoint_1.result().setColor(170, 0, 225)
 SketchCircle_1 = Sketch_1.addCircle(0, 0, 40)
-SketchCircle_1.result().setColor(225, 0, 0)
-SketchCircle_1.results()[1].setColor(225, 0, 0)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 40)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
 SketchLine_1 = SketchProjection_2.createdFeature()
-SketchLine_1.result().setColor(170, 0, 225)
 SketchArc_1 = Sketch_2.addArc(30, 0, 0, 0, 40.50885209855912, 28.09918197333542, True)
-SketchArc_1.result().setColor(225, 0, 0)
-SketchArc_1.results()[1].setColor(225, 0, 0)
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_1.result(), SketchArc_1.center())
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchArc_1.startPoint())
 SketchConstraintRadius_2 = Sketch_2.setRadius(SketchArc_1.results()[1], 30)
 model.do()
-Pipe_1 = model.addPipe(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "Sketch_2/Edge-SketchArc_1_2"))
+Pipe_1 = model.addPipe(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "Sketch_2/SketchArc_1_2"))
 model.do()
 model.end()
index d74ab4d23ccb71baa780f31f8459be2c905c3c66..433d523dada81f0ae319274a365923fb71c67928 100644 (file)
@@ -10,12 +10,7 @@ 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)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], 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"), model.selection("FACE", "Box_1_1/Front"), False, True)
 model.do()
 model.end()
index 295a9493c85fcd793b28fe6bfdbabc312e32add1..213b5501d94ec6c1e933194724ed79b76f81d9c4 100644 (file)
@@ -10,11 +10,6 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
 SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
 model.do()
-RevolutionCut_1 = model.addRevolutionCut(Part_1_doc,
-                                         [model.selection("COMPOUND", "Sketch_1")],
-                                         model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                                         0,
-                                         90,
-                                         [model.selection("SOLID", "Box_1_1")])
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), 0, 90, [model.selection("SOLID", "Box_1_1")])
 model.do()
 model.end()
index fba7ef0810f4f63c1ed903091d37ef2b8a923f8e..bf0c00f2a1ce992bec2a83b44c899cf38b5a4ed7 100644 (file)
@@ -10,13 +10,6 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
 SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
 model.do()
-RevolutionCut_1 = model.addRevolutionCut(Part_1_doc,
-                                         [model.selection("COMPOUND", "Sketch_1")],
-                                         model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                                         model.selection(),
-                                         0,
-                                         model.selection("FACE", "Box_1_1/Front"),
-                                         0,
-                                         [model.selection("SOLID", "Box_1_1")])
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), model.selection(), 0, model.selection("FACE", "Box_1_1/Front"), 0, [model.selection("SOLID", "Box_1_1")])
 model.do()
 model.end()
index 145a9a0fb52167094bc8feeb9b774293167f4ada..5aafe07fbb06d5bae15e0158c26c6ea0e7143645 100644 (file)
@@ -10,11 +10,6 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
 SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
 model.do()
-RevolutionCut_1 = model.addRevolutionFuse(Part_1_doc,
-                                          [model.selection("COMPOUND", "Sketch_1")],
-                                          model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                                          90,
-                                          0,
-                                          [model.selection("SOLID", "Box_1_1")])
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), 90, 0, [model.selection("SOLID", "Box_1_1")])
 model.do()
 model.end()
index 3e2c2e0ecbd96167171a1153e79bc6eee317398e..65ee5cd7a3b956d5e74971f43f78bceefc678cfa 100644 (file)
@@ -10,13 +10,6 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
 SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
 model.do()
-RevolutionCut_1 = model.addRevolutionFuse(Part_1_doc,
-                                          [model.selection("COMPOUND", "Sketch_1")],
-                                          model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                                          model.selection("FACE", "Box_1_1/Front"),
-                                          0,
-                                          model.selection(),
-                                          0,
-                                          [model.selection("SOLID", "Box_1_1")])
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), model.selection("FACE", "Box_1_1/Front"), 0, model.selection(), 0, [model.selection("SOLID", "Box_1_1")])
 model.do()
 model.end()
index 489541f93856e7f7531a38e446ef35b444707ac8..68f242c6a0fa9259f428a9e1bf5d89171bbf723e 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "Cone_1_1/Face_1&Cone_1_1/Face_3"), model.selection("VERTEX", "Cone_1_1/Face_1&Cone_1_1/Face_2"))
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "[Cone_1_1/Face_1][Cone_1_1/Face_3]"), model.selection("VERTEX", "[Cone_1_1/Face_1][Cone_1_1/Face_2]"))
 model.do()
 model.end()
index 3ceb146fef66200d4b8ce9fef5b42ad9969fd3b7..ac042b77021442839a5ea8e4a53a3b489e3253c6 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
-Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "Cylinder_1_1/Face_1"), False)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "([Cylinder_1_1/Face_1][Cylinder_1_1/Face_2])([Cylinder_1_1/Face_1][Cylinder_1_1/Face_3])"), False)
 model.do()
 model.end()
index d06a7ecad63e5d597a0b31042afcd1abfe4dddc5..955e212de5383c1118097d7601d1d195fc1aa6fc 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "Cone_1_1/Face_1&Cone_1_1/Face_2"))
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "[Cone_1_1/Face_1][Cone_1_1/Face_2]"))
 model.do()
 model.end()
index 5ebee45fad3983e85c78f7ed13de9878ff04685e..19a4887723fdd4b55617083b995cf7751471c005 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("EDGE", "Cone_1_1/Face_1"), 40)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("EDGE", "([Cone_1_1/Face_1][Cone_1_1/Face_2])([Cone_1_1/Face_1][Cone_1_1/Face_3])"), 40)
 model.do()
 model.end()
index f5ce125b4120318b538e3e3521e5605d93f3dcd2..d4336f5abb44d845e41fc6ba2cc0232834d77c84 100644 (file)
@@ -23,12 +23,7 @@ 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")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_5f-SketchLine_3f-SketchLine_4f")], 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()
index afe02011207e204d86fdf19b73a03c4e911a6f2e..4d31da36c5946131d2abb3c3f08c964808ebdd9f 100755 (executable)
@@ -948,6 +948,8 @@ bool ModuleBase_WidgetMultiSelector::findInSelection(const ObjectPtr& theObject,
                               const std::map<ObjectPtr, std::set<GeomShapePtr> >& theGeomSelection,
                               ModuleBase_IWorkshop* theWorkshop)
 {
+  if (!theObject.get())
+    return false;
   // issue #2154: we should not remove from list objects hidden in the viewer if selection
   // was done with SHIFT button
   if (theWorkshop->hasSHIFTPressed() && !theObject->isDisplayed())