]> SALOME platform Git repositories - modules/shaper.git/blob - src/BuildPlugin/Test/Test1920.py
Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / BuildPlugin / Test / Test1920.py
1 from salome.shaper import model
2
3 model.begin()
4 partSet = model.moduleDocument()
5 Part_1 = model.addPart(partSet)
6 Part_1_doc = Part_1.document()
7 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
8 SketchLine_1 = Sketch_1.addLine(0, 50, 100, 50)
9 SketchLine_2 = Sketch_1.addLine(100, 50, 100, 0)
10 SketchLine_3 = Sketch_1.addLine(100, 0, 0, 0)
11 SketchLine_4 = Sketch_1.addLine(0, 0, 0, 50)
12 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
13 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
14 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
15 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
16 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
17 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
18 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
19 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
20 SketchLine_5 = Sketch_1.addLine(50, 50, 50, 0)
21 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_1.result())
22 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_3.result())
23 model.do()
24 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r")])
25 Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_5f")])
26 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")], model.selection("EDGE", "PartSet/OY"), 100)
27 Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Translation_1_1/Translated_Edge_1"), model.selection("EDGE", "Translation_1_1/Translated_Edge_2"), model.selection("EDGE", "Translation_1_1/Translated_Edge_3"), model.selection("EDGE", "Translation_1_1/Translated_Edge_4"), model.selection("EDGE", "Translation_1_2/Translated_Edge_1"), model.selection("EDGE", "Translation_1_2/Translated_Edge_2"), model.selection("EDGE", "Translation_1_2/Translated_Edge_3"), model.selection("EDGE", "Translation_1_2/Translated_Edge_4")])
28 aGroupFeature = Group_1.feature()
29 aSelectionList = aGroupFeature.selectionList("group_list")
30 model.end()
31 assert(aSelectionList.size() == 8)
32 for index in range(0, aSelectionList.size()):
33     attrSelection = aSelectionList.value(index)
34     shape = attrSelection.value()
35     name = attrSelection.namingName()
36     assert(shape.isEdge())
37     assert(name)
38
39 assert(model.checkPythonDump())