Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/smesh.git] / src / SMESH_SWIG / SMESH_GroupLyingOnGeom.py
1 from smesh import *
2
3 def BuildGroupLyingOn(theMesh, theElemType, theName, theShape):
4     aFilterMgr = smesh.CreateFilterManager()
5     aFilter = aFilterMgr.CreateFilter()
6    
7     aLyingOnGeom = aFilterMgr.CreateLyingOnGeom()
8     aLyingOnGeom.SetGeom(theShape)
9     aLyingOnGeom.SetElementType(theElemType)
10     
11     aFilter.SetPredicate(aLyingOnGeom)
12     anIds = aFilter.GetElementsId(theMesh)
13
14     aGroup = theMesh.CreateGroup(theElemType, theName)
15     aGroup.Add(anIds)
16
17 #Example
18 from SMESH_test1 import *
19
20 smesh.Compute(mesh, box)
21 BuildGroupLyingOn(mesh, SMESH.FACE, "Group of faces lying on edge", edge )
22
23 salome.sg.updateObjBrowser(1);