1 # Adding an object to the group
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)
22 id_group1 = geompy.addToStudy(group, "Group1")
24 # display the contents of the group
25 gg.createAndDisplayGO(id_group1)
26 salome.sg.updateObjBrowser(1)