1from SketchAPI import *
2
3from salome.shaper import model
4
5model.begin()
6partSet = model.moduleDocument()
7
8### Create Part
9Part_1 = model.addPart(partSet)
10Part_1_doc = Part_1.document()
11
12### Create Box
13Box_1 = model.addBox(Part_1_doc, 200, 200, 200)
14Box_2 = model.addBox(Part_1_doc, 200, 200, 200)
15
16### Create Shell
17Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Box_1_1/Top"),
18 model.selection("FACE", "Box_1_1/Front"),
19 model.selection("FACE", "Box_1_1/Left")])
20
21# Offset of the whole shape, pipe joints (isPipeJoint = True)
22Offset_1 = model.addOffset(Part_1_doc, model.selection("SHELL", "Shell_1_1"), 70., True)
23
24# Partial offset. Negative offset value means offset in direction, opposite to normale.
25Offset_2 = model.addOffsetPartial(Part_1_doc,
26 model.selection("SOLID", "Box_2_1"),
27 -50.,
28 [model.selection("FACE", "Box_2_1/Top")])
29
30model.end()