SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
model.do()
Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/SketchLine_4"), 360, 0)
-Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][weak_name_3]")]
+Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])2"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])2")]
Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
model.do()
model.end()
SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_7")
model.do()
Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_6r-SketchLine_5r-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/SketchLine_4"), 360, 0)
-Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][weak_name_3]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])")]
+Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])2"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])2"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])")]
Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
model.do()
model.end()
SketchCircle_1 = Sketch_1.addCircle(-13.45056286489504, 169.4770920976776, 150.6703210346195)
model.do()
Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
-Group_1_objects = [model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_4/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_4/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_4/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_4/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_1][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_1][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2]")]
+Group_1_objects = [
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/From_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_4/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_4/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_4/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_4/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2]")
+]
Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
model.do()
model.end()
SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_2.results()[1], SketchArc_4.endPoint())
model.do()
Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 0)
-Group_1_objects = [model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_1"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_3_2"), model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_3/From_Face"), model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1_3/To_Face"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1&weak_name_2"), model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_4/From_Face"), model.selection("FACE", "Extrusion_1_1_4/To_Face"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2"), model.selection("FACE", "Extrusion_1_1_6/From_Face"), model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchArc_3_2"), model.selection("FACE", "Extrusion_1_1_6/To_Face"), model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_5/To_Face"), model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_2_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1_5/From_Face"), model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2"), model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchArc_3_2"), model.selection("FACE", "Extrusion_1_1_4/Generated_Face&Sketch_1/SketchArc_4_2"), model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchArc_4_2"), model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_2/From_Face"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_2_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_2/To_Face"), model.selection("FACE", "Extrusion_1_1_7/Generated_Face&Sketch_1/SketchCircle_2_2"), model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_2_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_7/To_Face"), model.selection("FACE", "Extrusion_1_1_7/From_Face"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1_1/To_Face")]
+Group_1_objects = [
+model.selection("FACE", "(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_4_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_3_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2)2"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"),
+model.selection("FACE", "(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_4_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_3_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2)2"),
+model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2"),
+model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_3_2"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_3"),
+model.selection("FACE", "Extrusion_1_1_3/From_Face"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_2"),
+model.selection("FACE", "Extrusion_1_1_3/To_Face"),
+model.selection("FACE", "(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_4_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_3_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2)2"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_3"),
+model.selection("FACE", "Extrusion_1_1_4/From_Face"),
+model.selection("FACE", "Extrusion_1_1_4/To_Face"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_2"),
+model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2"),
+model.selection("FACE", "Extrusion_1_1_6/From_Face"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchArc_3_2"),
+model.selection("FACE", "Extrusion_1_1_6/To_Face"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3"),
+model.selection("FACE", "Extrusion_1_1_5/To_Face"),
+model.selection("FACE", "(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_6/From_Face)(Extrusion_1_1_6/To_Face)(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_3_2)2(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3)2"),
+model.selection("FACE", "Extrusion_1_1_5/From_Face"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1"),
+model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchArc_3_2"),
+model.selection("FACE", "Extrusion_1_1_4/Generated_Face&Sketch_1/SketchArc_4_2"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchArc_4_2"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"),
+model.selection("FACE", "Extrusion_1_1_2/From_Face"),
+model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4"),
+model.selection("FACE", "(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_3_2)(Extrusion_1_1_6/From_Face)(Extrusion_1_1_6/To_Face)(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3)2"),
+model.selection("FACE", "Extrusion_1_1_2/To_Face"),
+model.selection("FACE", "Extrusion_1_1_7/Generated_Face&Sketch_1/SketchCircle_2_2"),
+model.selection("FACE", "(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_3_2)(Extrusion_1_1_6/From_Face)(Extrusion_1_1_6/To_Face)(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3)2"),
+model.selection("FACE", "Extrusion_1_1_7/To_Face"),
+model.selection("FACE", "Extrusion_1_1_7/From_Face"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1"),
+model.selection("FACE", "Extrusion_1_1_1/From_Face"),
+model.selection("FACE", "Extrusion_1_1_1/To_Face")
+]
Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
model.do()
model.end()
SketchLine_39.result().setName("SketchLine_40")
ExtrusionCut_1.setNestedSketch(Sketch_2)
ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, 20, [model.selection("SOLID", "ExtrusionCut_1_1")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_8&weak_name_1"))
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "(ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_23)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_25)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchArc_2_2)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_24)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchArc_3_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_12)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_11)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4)2(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_5)2(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9)2(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_21)2(ExtrusionCut_1_1/From_Face_1)2(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_27)2"))
SketchCircle_1 = Sketch_3.addCircle(-19.86097902097902, 65.28094405594405, 2.5)
SketchCircle_2 = Sketch_3.addCircle(-18.51902097902098, 27.57192307692308, 2)
SketchCircle_3 = Sketch_3.addCircle(-19.0558041958042, 85.54451048951049, 3)
ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], model.selection("EDGE", "Axis_1"), model.selection(), 0, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Box_1_1/Left"), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
SketchCircle_2 = Sketch_2.addCircle(10, 10, 2.040695131136049)
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Box_1_1/Right][Box_1_1/Front][ExtrusionCut_1_1/Modified_Face&Box_1_1/Top&weak_name_2]"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Box_1_1/Right][Box_1_1/Front][(ExtrusionCut_1_1/Modified_Face&Box_1_1/Left)(ExtrusionCut_1_1/Modified_Face&Box_1_1/Right)(Box_1_1/Front)(Box_1_1/Back)2(Box_1_1/Bottom)2]"), False)
SketchPoint_1 = SketchProjection_2.createdFeature()
SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchCircle_2.center(), SketchAPI_Point(SketchPoint_1).coordinates())
ExtrusionCut_2.setNestedSketch(Sketch_2)
aNewShape = aNS->Get();
if (anOldShape.IsNull() || aNewShape.IsNull() || !anOldShape.IsEqual(aNewShape)) {
+ bool aIsRemoved = false; // this may be removed, so, don't send the "update" message
// shape type should not be changed: if shape becomes compound of such shapes, then split
if (myParent && !anOldShape.IsNull() && !aNewShape.IsNull() &&
anOldShape.ShapeType() != aNewShape.ShapeType() &&
aNewShape.ShapeType() == TopAbs_COMPOUND) {
split(aContext, aNewShape, anOldShape.ShapeType());
+ } else if (myParent && !aNewShape.IsNull()) { // merge: remove equal shapes from the list
+ aIsRemoved = myParent->merge(this);
}
- owner()->data()->sendAttributeUpdated(this); // send updated if shape is changed
+ if (!aIsRemoved)
+ owner()->data()->sendAttributeUpdated(this); // send updated if shape is changed
}
return aResult;
}
return !aName.empty();
}
-TDF_Label Model_AttributeSelection::selectionLabel()
+TDF_Label Model_AttributeSelection::selectionLabel() const
{
return myRef.myRef->Label().FindChild(1);
}
/// Returns the label where TNaming_Selection results are stored
/// Note: there must be no attributes stored at the same label because Selector clears this lab
- TDF_Label selectionLabel();
+ TDF_Label selectionLabel() const;
/// Sets the ID of the attribute in Data (called from Data): here it is used for myRef ID setting
MODEL_EXPORT virtual void setID(const std::string theID);
myCash.clear(); // empty list as indicator that cash is not used
owner()->data()->sendAttributeUpdated(this);
}
+
+bool Model_AttributeSelectionList::merge(Model_AttributeSelection* theStart)
+{
+ int aSize = size();
+ TDF_Label aStartLab = theStart->selectionLabel().Father();
+ ResultPtr aContext = theStart->context();
+ if (aContext.get()) {
+ GeomShapePtr aValue = theStart->value();
+ if (aValue.get() && !aValue->isNull()) {
+ for(int anIndex = aStartLab.Tag(); anIndex < aSize; anIndex++) {
+ AttributeSelectionPtr aSel = value(anIndex);
+ if (aContext == aSel->context() && aValue->isSame(aSel->value())) { // remove theStart
+ std::set<int> aRemoved;
+ aRemoved.insert(aStartLab.Tag() - 1);
+ remove(aRemoved);
+ // also re-select theStart to make name cover both attributes (after split of merged)
+ aSel = value(anIndex - 1); // attributes of this attribute were moved up by "remove"
+ static ObjectPtr anEmptyContext;
+ static GeomShapePtr anEmptyShape;
+ aSel->setValue(anEmptyContext, anEmptyShape);
+ aSel->setValue(aContext, aValue);
+ return true;
+ }
+ }
+ }
+ }
+ return false; // not merged
+}
/// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)
virtual void reinit();
+ /// Tries to merge attributes in this list with the same result shape. Returns true
+ /// if theStart matches with some later attribute and theStart is removed from the list.
+ bool merge(Model_AttributeSelection* theStart);
+
friend class Model_Data;
+ friend class Model_AttributeSelection;
};
#endif
bool aNewShapeIsSameAsOldShape = anOldSubShape->isSame(aNewShape);
bool aNewShapeIsNotInResultShape = !aResultShape->isSubShape(aNewShape, false);
- if (aNewShapeIsSameAsOldShape
- || aNewShapeIsNotInResultShape)
- {
+ if (aNewShapeIsSameAsOldShape || aNewShapeIsNotInResultShape) {
continue;
}
storeExternalReference(anOriginalLabel, builder(aTag)->NamedShape()->Label());
}
buildName(aTag, theName);
- }
- else {
+ } if (aResultShape->isSame(aNewShape)) {
+ // keep the generation evolution on the root level (2397 - for intersection feature)
+ TNaming_Builder* aBuilder = builder(0);
+ TDF_Label aShapeLab = aBuilder->NamedShape()->Label();
+ Handle(TDF_Reference) aRef;
+ if (aShapeLab.FindAttribute(TDF_Reference::GetID(), aRef)) {
+ // Store only in case if it does not have reference.
+ continue;
+ }
+
+ // Check if new shape was already stored.
+ if (isAlreadyStored(aBuilder, anOldSubShape_, aNewShape_)) continue;
+
+ if (!aBuilder->NamedShape().IsNull() &&
+ aBuilder->NamedShape()->Evolution() != TNaming_GENERATED) {
+ myBuilders.erase(0); // clear old builder to avoid different evolutions crash
+ aBuilder = builder(0);
+ }
+ aBuilder->Generated(anOldSubShape_, aNewShape_);
+ } else {
int aTag = getGenerationTag(aNewShape_);
if (aTag == INVALID_TAG) return;
builder(aTag)->Generated(anOldSubShape_, aNewShape_);
TestSaveOpen2.py
TestSelectionInitialization.py
Test2828.py
+ TestSelectionMerge.py
)
--- /dev/null
+## Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Param_H = model.addParameter(Part_1_doc, "height", "3")
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, "height", [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
+SketchLine_1 = Sketch_1.addLine(6, 1, 4, 1)
+SketchLine_1.setName("SketchLine_3")
+SketchLine_1.result().setName("SketchLine_3")
+SketchLine_2 = Sketch_1.addLine(5, -1, 4, 1)
+SketchLine_2.setName("SketchLine_2")
+SketchLine_2.result().setName("SketchLine_2")
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.endPoint())
+SketchLine_3 = Sketch_1.addLine(5, -1, 6, 1)
+SketchLine_3.setName("SketchLine_4")
+SketchLine_3.result().setName("SketchLine_4")
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
+ExtrusionCut_1.setNestedSketch(Sketch_1)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Box_1_1/Left")])
+model.do()
+groupSelectionList = Group_1.feature().selectionList("group_list")
+assert(groupSelectionList.size() == 1)
+# cut the face fully
+Param_H.setValue(10)
+model.do()
+assert(groupSelectionList.size() == 2)
+# merge the face back
+Param_H.setValue(2)
+# split again
+Param_H.setValue(10)
+model.do()
+assert(groupSelectionList.size() == 2)
+# merge the face back
+Param_H.setValue(2)
+model.end()
+assert(groupSelectionList.size() == 1)
+
+assert(model.checkPythonDump())
const int theLevel, TopTools_MapOfShape& theResult)
{
TopAbs_ShapeEnum aConnectorType = TopAbs_VERTEX; // type of the connector sub-shapes
- if (theValue.ShapeType() == TopAbs_FACE)
+ TopAbs_ShapeEnum aValueType = theValue.ShapeType();
+ if (aValueType == TopAbs_FACE)
aConnectorType = TopAbs_EDGE;
+ else if (aValueType == TopAbs_COMPOUND) { // for geometrical naming: compound of faces
+ TopExp_Explorer anExp(theValue, TopAbs_FACE);
+ if (anExp.More()) {
+ aConnectorType = TopAbs_EDGE;
+ aValueType = TopAbs_FACE;
+ } else {
+ aValueType = TopAbs_EDGE;
+ }
+ }
TopTools_MapOfShape aNBConnectors; // connector shapes that already belong to neighbors
- for(TopExp_Explorer aValExp(theValue, aConnectorType); aValExp.More(); aValExp.Next()) {
+ for(TopExp_Explorer aValExp(theValue, aConnectorType); aValExp.More(); aValExp.Next())
aNBConnectors.Add(aValExp.Current());
- }
TopTools_MapOfShape alreadyProcessed;
- alreadyProcessed.Add(theValue);
+ if (aValueType == theValue.ShapeType())
+ alreadyProcessed.Add(theValue);
+ else
+ for(TopExp_Explorer aValExp(theValue, aValueType); aValExp.More(); aValExp.Next())
+ alreadyProcessed.Add(aValExp.Current());
for(int aLevel = 1; aLevel <= theLevel; aLevel++) {
TopoDS_ListOfShape aGoodCandidates;
- TopExp_Explorer aCandidate(theContext, theValue.ShapeType());
+ TopExp_Explorer aCandidate(theContext, aValueType);
for(; aCandidate.More(); aCandidate.Next()) {
if (alreadyProcessed.Contains(aCandidate.Current()))
continue;
if (aNBIter->second == aMinLevel) {
TopTools_MapOfShape aThisNBs;
findNeighbors(theContext, aNBIter->first, aMinLevel, aThisNBs);
- // aMatches must contain common part of all NBs lists
- for(TopTools_MapOfShape::Iterator aThisNB(aThisNBs); aThisNB.More(); aThisNB.Next()) {
- if (aFirst) {
+ if (aFirst) { // aMatches must contain common part of all NBs lists
+ for(TopTools_MapOfShape::Iterator aThisNB(aThisNBs); aThisNB.More(); aThisNB.Next()) {
aMatches.Append(aThisNB.Value());
- } else {
- // remove all in aMatches which are not in this NBs
- for(TopoDS_ListOfShape::Iterator aMatch(aMatches); aMatch.More(); ) {
- if (aThisNBs.Contains(aMatch.Value())) {
- aMatch.Next();
- } else {
- aMatches.Remove(aMatch);
- }
+ }
+ } else { // remove all in aMatches which are not in this NBs
+ for(TopoDS_ListOfShape::Iterator aMatch(aMatches); aMatch.More(); ) {
+ if (aThisNBs.Contains(aMatch.Value())) {
+ aMatch.Next();
+ } else {
+ aMatches.Remove(aMatch);
}
}
}
} else
return TopoDS_Shape();
}
+ break; // no more NBs with higher levels
}
if (!aLevelNBs.IsEmpty()) {
TopTools_MapOfShape aNBsOfCandidate;
Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&ExtrusionCut_1_1/From_Face"))
SketchProjection_2 = Sketch_3.addProjection(model.selection("VERTEX", "ExtrusionCut_1_1/Generated_Vertex&ExtrusionCut_1_1/From_Face"), False)
SketchPoint_3 = SketchProjection_2.createdFeature()
-SketchProjection_3 = Sketch_3.addProjection(model.selection("EDGE", "ExtrusionCut_1_1/Generated_Edge&ExtrusionCut_1_1/From_Face&weak_name_2"), False)
+SketchProjection_3 = Sketch_3.addProjection(model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])2([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2])2([ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])2"), False)
SketchLine_11 = SketchProjection_3.createdFeature()
SketchArc_3 = Sketch_3.addArc(-15, 35, -15, 46.0103340429751, -17.02045759563166, 24.17663606626138, True)
SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchPoint_3.result(), SketchArc_3.center())
SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_11.result(), SketchArc_3.startPoint())
-SketchProjection_4 = Sketch_3.addProjection(model.selection("EDGE", "ExtrusionCut_1_1/Generated_Edge&ExtrusionCut_1_1/From_Face&weak_name_1"), False)
+SketchProjection_4 = Sketch_3.addProjection(model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])2([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2])2([ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2])2"), False)
SketchArc_4 = SketchProjection_4.createdFeature()
SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchArc_3.endPoint(), SketchArc_4.results()[1])
SketchLine_12 = Sketch_3.addLine(-15, 46.0103340429751, -15, 35)