Salome HOME
48590c8eb62117d0b7009fcce04e65b0e187a9ee
[modules/shaper.git] / src / FeaturesPlugin / Test / Test2046.py
1 from salome.shaper import model
2
3 model.begin()
4 partSet = model.moduleDocument()
5 Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
6 SketchLine_1 = Sketch_1.addLine(-1154.716981132076, -199.5283018867925, -849.0566037735849, 128.7735849056603)
7 SketchLine_2 = Sketch_1.addLine(-849.0566037735849, 128.7735849056603, -563.2075471698113, -69.33962264150945)
8 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
9 SketchLine_3 = Sketch_1.addLine(-563.2075471698113, -69.33962264150945, -70.75471698113215, 326.8867924528301)
10 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
11 model.do()
12 Part_1 = model.addPart(partSet)
13 Part_1_doc = Part_1.document()
14 Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_3")])
15 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 100, 0)
16 Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1")])
17 model.do()
18 model.end()
19
20 groupFeature = Group_1.feature()
21 groupSelectionList = groupFeature.selectionList("group_list")
22 assert(groupSelectionList.size() == 3)
23 for index in range(0, groupSelectionList.size()):
24   attrSelection = groupSelectionList.value(index)
25   shape = attrSelection.value()
26   name = attrSelection.namingName()
27   assert(shape.isFace())
28   assert(name != ""), "Empty shape name"