Salome HOME
21680: EDF 2288 SMESH: creation of 0D elements from other elements
authoreap <eap@opencascade.com>
Tue, 23 Oct 2012 07:52:48 +0000 (07:52 +0000)
committereap <eap@opencascade.com>
Tue, 23 Oct 2012 07:52:48 +0000 (07:52 +0000)
+    def Add0DElementsToAllNodes(self, theObject, theGroupName=""):

src/SMESH_SWIG/smeshDC.py

index e224ade4c5c8eee268352dadbe428bac06a24d30..c57c6773d6218fbae4535967dc02c58bd9864e61 100644 (file)
@@ -2334,6 +2334,24 @@ class Mesh:
     def Add0DElement(self, IDOfNode):
         return self.editor.Add0DElement(IDOfNode)
 
+    ## Create 0D elements on all nodes of the given elements except those 
+    #  nodes on which a 0D element already exists.
+    #  @param theObject an object on whose nodes 0D elements will be created.
+    #         It can be mesh, sub-mesh, group, list of element IDs or a holder
+    #         of nodes IDs created by calling mesh.GetIDSource( nodes, SMESH.NODE )
+    #  @param theGroupName optional name of a group to add 0D elements created
+    #         and/or found on nodes of \a theObject.
+    #  @return an object (a new group or a temporary SMESH_IDSource) holding
+    #          IDs of new and/or found 0D elements. IDs of 0D elements 
+    #          can be retrieved from the returned object by calling GetIDs()
+    #  @ingroup l2_modif_add
+    def Add0DElementsToAllNodes(self, theObject, theGroupName=""):
+        if isinstance( theObject, Mesh ):
+            theObject = theObject.GetMesh()
+        if isinstance( theObject, list ):
+            theObject = self.GetIDSource( theObject, SMESH.ALL )
+        return self.editor.Create0DElementsOnAllNodes( theObject, theGroupName )
+
     ## Creates a ball element on a node with given ID.
     #  @param IDOfNode the ID of node for creation of the element.
     #  @param diameter the bal diameter.