Salome HOME
#17319: EDF 20003 - suppress Meshes in TUI
[modules/smesh.git] / src / SMESH_SWIG / smeshBuilder.py
index cf5facce8bf828eb22d885810a5953152efc049a..464cf3714c38e660117d02ab464fa00ce4f02aef 100644 (file)
@@ -475,6 +475,24 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ):
             obj,name = name,obj
         return Mesh(self, self.geompyD, obj, name)
 
+    def RemoveMesh( self, mesh ):
+        """
+        Delete a mesh
+        """
+        if isinstance( mesh, Mesh ):
+            mesh = mesh.GetMesh()
+            pass
+        if not isinstance( mesh, SMESH._objref_SMESH_Mesh ):
+            raise TypeError("%s is not a mesh" % mesh )
+        so = salome.ObjectToSObject( mesh )
+        if so:
+            sb = salome.myStudy.NewBuilder()
+            sb.RemoveObjectWithChildren( so )
+        else:
+            mesh.UnRegister()
+            pass
+        return
+
     def EnumToLong(self,theItem):
         """
         Return a long value from enumeration
@@ -812,7 +830,7 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ):
 
         Parameters:
                 sourceMesh: the mesh to copy definition of.
-                newGeom: the new geomtry.
+                newGeom: the new geometry.
                 meshName: an optional name of the new mesh. If omitted, the mesh name is kept.
                 toCopyGroups: to create groups in the new mesh.
                 toReuseHypotheses: to reuse hypotheses of the *sourceMesh*.
@@ -823,7 +841,7 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ):
                 *invalidEntries* are study entries of objects whose
                 counterparts are not found in the *newGeom*, followed by entries
                 of mesh sub-objects that are invalid because they depend on a not found
-                preceeding sub-shape
+                preceding sub-shape
         """
         if isinstance( sourceMesh, Mesh ):
             sourceMesh = sourceMesh.GetMesh()
@@ -4490,8 +4508,8 @@ class Mesh(metaclass = MeshMeta):
         Reorient faces contained in *the2DObject*.
 
         Parameters:
-                the2DObject: is a :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>` or list of IDs of 2D elements
-                theDirection: is a desired direction of normal of *theFace*.
+                the2DObject: a :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>` or list of IDs of 2D elements
+                theDirection: a desired direction of normal of *theFace*.
                         It can be either a GEOM vector or a list of coordinates [x,y,z].
                 theFaceOrPoint: defines a face of *the2DObject* whose normal will be
                         compared with theDirection. It can be either ID of face or a point
@@ -6419,7 +6437,7 @@ class Mesh(metaclass = MeshMeta):
             holeNodes = SMESH.FreeBorder(nodeIDs=holeNodes)
         if not isinstance( holeNodes, SMESH.FreeBorder ):
             raise TypeError("holeNodes must be either SMESH.FreeBorder or list of integer and not %s" % holeNodes)
-        self.editor.FillHole( holeNodes, groupName )
+        return self.editor.FillHole( holeNodes, groupName )
 
     def FindCoincidentFreeBorders (self, tolerance=0.):
         """