1from SketchAPI import *
2
3from salome.shaper import model
4
5model.begin()
6partSet = model.moduleDocument()
7Part_1 = model.addPart(partSet)
8Part_1_doc = Part_1.document()
9Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
10SketchLine_1 = Sketch_1.addLine(0, 75.67806267806267, 34.24216524216526, 75.67806267806267)
11SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
12SketchLine_2 = SketchProjection_1.createdFeature()
13SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result())
14SketchLine_3 = Sketch_1.addLine(34.24216524216526, 75.67806267806267, 34.24216524216526, 46.03988603988604)
15SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint())
16SketchLine_4 = Sketch_1.addLine(34.24216524216526, 46.03988603988604, 63.30484330484332, 46.03988603988604)
17SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
18SketchLine_5 = Sketch_1.addLine(63.30484330484332, 46.03988603988604, 63.30484330484332, -2.775557561562891e-17)
19SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
20SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
21SketchLine_6 = SketchProjection_2.createdFeature()
22SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result())
23SketchLine_7 = Sketch_1.addLine(63.30484330484332, -2.775557561562891e-17, 0, 0)
24SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_7.startPoint())
25SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_7.endPoint())
26SketchLine_8 = Sketch_1.addLine(0, 75.67806267806267, 0, 0)
27SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_8.startPoint())
28SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_8.endPoint())
29SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
30SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result())
31SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
32SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
33model.do()
34Extrusion_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)
35Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 0, 50)
36Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")])
37FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", "Fuse_1_1"))
38model.do()
39model.end()