5 gg = salome.ImportComponentGUI("GEOM")
8 p0 = geompy.MakeVertex(0. , 0. , 0. )
9 p200 = geompy.MakeVertex(200., 200., 200.)
11 # create a box from two points
12 Box = geompy.MakeBoxTwoPnt(p0, p200)
14 # create a group from the faces of the box
15 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
17 # add objects to the group
18 SubFaceList = geompy.SubShapeAllSortedCentres(Box, geompy.ShapeType["FACE"])
20 FaceID = geompy.GetSubShapeID(Box, SubFaceList[i])
21 geompy.AddObject(group, FaceID)
23 # add all selected shapes from the list to the group
24 # (the program doesn't raise error, if some shapes are already included)
25 geompy.UnionList(group, [SubFaceList[0], SubFaceList[2], SubFaceList[5]])
27 # remove an object from the group
28 geompy.RemoveObject(group, FaceID)
30 # remove all selected shapes from the group
31 # (the program doesn't raise error, if some shapes are not included)
32 geompy.DifferenceList(group, [SubFaceList[2], SubFaceList[3], SubFaceList[4]])
33 id_group1 = geompy.addToStudy(group, "Group1")
35 # display the contents of the group
36 gg.createAndDisplayGO(id_group1)
37 salome.sg.updateObjBrowser(1)