Create Sewing

 1from salome.shaper import model
 2
 3model.begin()
 4partSet = model.moduleDocument()
 5Part_1 = model.addPart(partSet)
 6Part_1_doc = Part_1.document()
 7model.addParameter(Part_1_doc, "dx", '10')
 8model.addParameter(Part_1_doc, "alfa", '90')
 9
10Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
11Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
12Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], axis = model.selection("EDGE", "PartSet/OX"), distance = "dx", keepSubResults = True)
13Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], axis = model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), angle = "alfa", keepSubResults = True)
14
15Shell_1_objects = [model.selection("FACE", "Box_1_1/Top"),
16                   model.selection("FACE", "Box_1_1/Left"),
17                   model.selection("FACE", "Box_1_1/Right"),
18                   model.selection("FACE", "Box_1_1/Back"),
19                   model.selection("FACE", "Box_1_1/Bottom")]
20Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
21
22Shell_2_objects = [model.selection("FACE", "Rotation_1_1/MF:Rotated&Box_2_1/Top"),
23                   model.selection("FACE", "Rotation_1_1/MF:Rotated&Box_2_1/Left"),
24                   model.selection("FACE", "Rotation_1_1/MF:Rotated&Box_2_1/Front"),
25                   model.selection("FACE", "Rotation_1_1/MF:Rotated&Box_2_1/Right"),
26                   model.selection("FACE", "Rotation_1_1/MF:Rotated&Box_2_1/Bottom")]
27Shell_2 = model.addShell(Part_1_doc, Shell_2_objects)
28
29Sewing_1 = model.addSewing(Part_1_doc, [model.selection("SHELL", "Shell_2_1"), model.selection("SHELL", "Shell_1_1")], 1e-07, allowNonManifold = False, alwaysCreateResult = True)
30
31model.end()

Download this script