]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/examples/working_with_groups_ex06.py
Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / working_with_groups_ex06.py
1 # Cut Groups
2
3 import geompy
4 import salome
5
6 # create a box and some groups of faces on it
7 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
8 Group_1 = geompy.CreateGroup(Box_1, geompy.ShapeType["FACE"])
9 geompy.UnionIDs(Group_1, [13, 23])
10 Group_2 = geompy.CreateGroup(Box_1, geompy.ShapeType["FACE"])
11 geompy.UnionIDs(Group_2, [3, 27])
12 Group_3 = geompy.CreateGroup(Box_1, geompy.ShapeType["FACE"])
13 geompy.UnionIDs(Group_3, [33, 23])
14 Group_4 = geompy.CreateGroup(Box_1, geompy.ShapeType["FACE"])
15 geompy.UnionIDs(Group_4, [31, 27])
16
17 # cut groups
18 Group_C_2_4 = geompy.CutGroups(Group_2, Group_4)
19 Group_CL_2_4 = geompy.CutListOfGroups([Group_2], [Group_4])
20
21 # publish shapes
22 geompy.addToStudy(Box_1, 'Box_1')
23 geompy.addToStudyInFather(Box_1, Group_1, 'Group_1')
24 geompy.addToStudyInFather(Box_1, Group_2, 'Group_2')
25 geompy.addToStudyInFather(Box_1, Group_3, 'Group_3')
26 geompy.addToStudyInFather(Box_1, Group_4, 'Group_4')
27 geompy.addToStudyInFather(Box_1, Group_C_2_4, 'Group_C_2_4')
28 geompy.addToStudyInFather(Box_1, Group_CL_2_4, 'Group_CL_2_4')
29 salome.sg.updateObjBrowser(1)