Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'V7_dev'
[modules/smesh.git]
/
doc
/
salome
/
examples
/
grouping_elements_ex08.py
diff --git
a/doc/salome/examples/grouping_elements_ex08.py
b/doc/salome/examples/grouping_elements_ex08.py
index fa78d72f3f82c6f33bdcc5fb541716a7ded0c1e4..92dd71ce06141316870ccbbacb77320505fa3c5e 100644
(file)
--- a/
doc/salome/examples/grouping_elements_ex08.py
+++ b/
doc/salome/examples/grouping_elements_ex08.py
@@
-1,4
+1,4
@@
-# Creating groups of entities
from existing groups of superior dimension
s
+# Creating groups of entities
basing on nodes of other group
s
import SMESH_mechanic
import SMESH
import SMESH_mechanic
import SMESH
@@
-10,22
+10,17
@@
salome = SMESH_mechanic.salome
# Criterion : AREA > 100
aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
# Criterion : AREA > 100
aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
-anIds = mesh.GetIdsFromFilter(aFilter)
-
-print "Criterion: Area > 100, Nb = ", len(anIds)
-
# create a group by adding elements with area > 100
# create a group by adding elements with area > 100
-aSrcGroup1 = mesh.MakeGroupByIds("Area > 100", SMESH.FACE, anIds)
+aSrcGroup1 = mesh.GroupOnFilter(SMESH.FACE, "Area > 100", aFilter)
+print "Criterion: Area > 100, Nb = ", aSrcGroup1.Size()
# Criterion : AREA < 30
aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 30.)
# Criterion : AREA < 30
aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 30.)
-anIds = mesh.GetIdsFromFilter(aFilter)
-
-print "Criterion: Area < 30, Nb = ", len(anIds)
-
# create a group by adding elements with area < 30
# create a group by adding elements with area < 30
-aSrcGroup2 = mesh.MakeGroupByIds("Area < 30", SMESH.FACE, anIds)
+aSrcGroup2 = mesh.GroupOnFilter(SMESH.FACE, "Area < 30", aFilter)
+print "Criterion: Area < 30, Nb = ", aSrcGroup2.Size()
+
# Create group of edges using source groups of faces
aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.EDGE, "Edges" )
# Create group of edges using source groups of faces
aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.EDGE, "Edges" )