From: eap Date: Tue, 23 Oct 2012 07:52:48 +0000 (+0000) Subject: 21680: EDF 2288 SMESH: creation of 0D elements from other elements X-Git-Tag: V6_6_0b1~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=08c538cf8f229f769dc1129d9db263d9ee6ca434;p=modules%2Fsmesh.git 21680: EDF 2288 SMESH: creation of 0D elements from other elements + def Add0DElementsToAllNodes(self, theObject, theGroupName=""): --- diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index e224ade4c..c57c6773d 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -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.