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