1 # Creating groups of entities basing on nodes of other groups
6 smesh = SMESH_mechanic.smesh
7 mesh = SMESH_mechanic.mesh
8 salome = SMESH_mechanic.salome
10 # Criterion : AREA > 100
11 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
13 # create a group by adding elements with area > 100
14 aSrcGroup1 = mesh.GroupOnFilter(SMESH.FACE, "Area > 100", aFilter)
15 aSrcGroup1.SetColor( SALOMEDS.Color(1.,1.,0.))
16 print("Criterion: Area > 100, Nb = ", aSrcGroup1.Size())
18 # Criterion : AREA < 30
19 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 30.)
21 # create a group by adding elements with area < 30
22 aSrcGroup2 = mesh.GroupOnFilter(SMESH.FACE, "Area < 30", aFilter)
23 aSrcGroup2.SetColor( SALOMEDS.Color(1.,0.,0.))
24 print("Criterion: Area < 30, Nb = ", aSrcGroup2.Size())
27 # Create group of edges using source groups of faces
28 aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.EDGE, "Edges" )
30 # Create group of nodes using source groups of faces
31 aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.NODE, "Nodes" )
33 salome.sg.updateObjBrowser()