Salome HOME
0022108: EDF 2547 SMESH: Duplicate elements only
[modules/smesh.git] / doc / salome / examples / grouping_elements_ex01.py
1 # Create a Standalone Group
2
3 import SMESH_mechanic
4 import SMESH
5
6 smesh  = SMESH_mechanic.smesh
7 mesh   = SMESH_mechanic.mesh
8 salome = SMESH_mechanic.salome
9
10 # Get ids of all faces with area > 100 
11 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
12
13 anIds = mesh.GetIdsFromFilter(aFilter) 
14
15 # create a group consisting of faces with area > 100
16 aGroup1 = mesh.MakeGroupByIds("Area > 100", SMESH.FACE, anIds)
17
18 # create a group that contains all nodes from the mesh
19 aGroup2 = mesh.CreateEmptyGroup(SMESH.NODE, "all nodes")
20 aGroup2.AddFrom(mesh.mesh)
21
22 salome.sg.updateObjBrowser(1)