Salome HOME
Issue #2044: Error detection in the parametric API
[modules/shaper.git] / src / PythonAPI / Test / Test2044.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(-184.375, -81.25, -71.87500000000006, 206.2500000000001)
9 SketchLine_2 = Sketch_1.addLine(-71.87500000000006, 206.2500000000001, 281.2500000000001, 178.125)
10 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
11 SketchLine_3 = Sketch_1.addLine(281.2500000000001, 178.125, 184.3750000000001, -109.375)
12 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
13 SketchLine_4 = Sketch_1.addLine(184.3750000000001, -109.375, -184.375, -81.25)
14 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
15 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
16 model.do()
17 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection("EDGE", "PartSet/OZ"), 50, 0)
18 model.do()
19 Extrusion_1.setDirection(model.selection("EDGE", "OX"))
20 model.do()
21 model.end()
22
23 assert (len(Extrusion_1.feature().error()) != 0)