6 smesh = SMESH_mechanic.smesh
7 mesh = SMESH_mechanic.mesh
8 salome = SMESH_mechanic.salome
10 # Criterion : AREA > 20
11 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 20.)
13 anIds = mesh.GetIdsFromFilter(aFilter)
15 print "Criterion: Area > 20, Nb = ", len(anIds)
17 # create a group by adding elements with area > 20
18 aGroupMain = mesh.MakeGroupByIds("Area > 20", SMESH.FACE, anIds)
20 # Criterion : AREA < 60
21 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 60.)
23 anIds = mesh.GetIdsFromFilter(aFilter)
25 print "Criterion: Area < 60, Nb = ", len(anIds)
27 # create a group by adding elements with area < 60
28 aGroupTool = mesh.MakeGroupByIds("Area < 60", SMESH.FACE, anIds)
30 # create a cut of groups : area >= 60
31 aGroupRes = mesh.CutGroups(aGroupMain, aGroupTool, "Area >= 60")
32 print "Criterion: Area >= 60, Nb = ", len(aGroupRes.GetListOfID())
33 # Please note that also there is CutListOfGroups() method which works with lists of groups of any lengths
35 salome.sg.updateObjBrowser()