smesh/doc/salome/examples/grouping_elements_ex01.py

23 lines
603 B
Python
Raw Normal View History

2013-02-12 20:37:44 +06:00
# Create a Standalone Group
import SMESH_mechanic
import SMESH
2013-02-12 20:37:44 +06:00
smesh = SMESH_mechanic.smesh
mesh = SMESH_mechanic.mesh
salome = SMESH_mechanic.salome
# Get ids of all faces with area > 100
aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
2013-02-12 20:37:44 +06:00
anIds = mesh.GetIdsFromFilter(aFilter)
# create a group consisting of faces with area > 100
aGroup1 = mesh.MakeGroupByIds("Area > 100", SMESH.FACE, anIds)
2013-02-12 20:37:44 +06:00
# create a group that contains all nodes from the mesh
aGroup2 = mesh.CreateEmptyGroup(SMESH.NODE, "all nodes")
2013-02-12 20:37:44 +06:00
aGroup2.AddFrom(mesh.mesh)
salome.sg.updateObjBrowser(1)