-\anchor tui_union_of_two_groups
-<h2>Union of two groups</h2>
-
-\code
-import SMESH_mechanic
-
-smesh = SMESH_mechanic.smesh
-mesh = SMESH_mechanic.mesh
-salome = SMESH_mechanic.salome
-
-# Criterion : AREA > 20
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 20.)
-
-anIds = mesh.GetIdsFromFilter(aFilter)
-
-print "Criterion: Area > 20, Nb = ", len( anIds )
-
-# create a group by adding elements with area > 20
-aGroup1 = mesh.CreateEmptyGroup(SMESH.FACE, "Area > 20")
-aGroup1.Add(anIds)
-
-# Criterion : AREA = 20
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_EqualTo, 20.)
-
-anIds = mesh.GetIdsFromFilter(aFilter)
-
-print "Criterion: Area = 20, Nb = ", len( anIds )
-
-# create a group by adding elements with area = 20
-aGroup2 = mesh.CreateEmptyGroup( smesh.FACE, "Area = 20" )
-
-aGroup2.Add(anIds)
-
-# create union group : area >= 20
-aGroup3 = mesh.UnionGroups(aGroup1, aGroup2, "Area >= 20")
-print "Criterion: Area >= 20, Nb = ", len(aGroup3.GetListOfID())
-
-# Criterion : AREA < 20
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 20.)
-
-anIds = mesh.GetIdsFromFilter(aFilter)
-
-print "Criterion: Area < 20, Nb = ", len(anIds)
-
-# create a group by adding elements with area < 20
-aGroup4 = mesh.CreateEmptyGroup(smesh.FACE, "Area < 20")
-aGroup4.Add(anIds)
-
-# create union group : area >= 20 and area < 20
-aGroup5 = mesh.UnionGroups(aGroup3, aGroup4, "Any Area")
-print "Criterion: Any Area, Nb = ", len(aGroup5.GetListOfID())
-
-salome.sg.updateObjBrowser(1)
-\endcode