Salome HOME
Cosmetics. Move XML files to the separate folder inside a corresponding project in VS.
[modules/shaper.git] / src / SketchPlugin / doc / examples / sketchcopy.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(50, 0, 0, 0)
7 SketchLine_2 = Sketch_1.addLine(0, 0, 0, 50)
8 SketchLine_3 = Sketch_1.addLine(0, 50, 50, 50)
9 SketchLine_4 = Sketch_1.addLine(50, 50, 50, 0)
10 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
11 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
12 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
13 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
14 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
15 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
16 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
17 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
18 model.do()
19
20 Sketch_1_Copy = model.copySketch(partSet, Sketch_1)
21
22 model.end()