Salome HOME
PAL20544 4x: problems with Concatenate().
[modules/smesh.git] / src / SMESH_SWIG / smeshDC.py
index 88aa2a6f6e226014d4414c214ffa4e2cfffba671..4b6ab7036490b82d2d7c28935ffbea1abd8d123d 100644 (file)
@@ -174,6 +174,10 @@ def GetName(obj):
 
 ## Sets a name to the object
 def SetName(obj, name):
+    if isinstance( obj, Mesh ):
+        obj = obj.GetMesh()
+    elif isinstance( obj, Mesh_Algorithm ):
+        obj = obj.GetAlgorithm()
     ior  = salome.orb.object_to_string(obj)
     sobj = salome.myStudy.FindObjectIOR(ior)
     if not sobj is None:
@@ -233,9 +237,7 @@ class smeshDC(SMESH._objref_SMESH_Gen):
     ## Sets the current study and Geometry component
     #  @ingroup l1_auxiliary
     def init_smesh(self,theStudy,geompyD):
-        self.geompyD=geompyD
-        self.SetGeomEngine(geompyD)
-        self.SetCurrentStudy(theStudy)
+        self.SetCurrentStudy(theStudy,geompyD)
 
     ## Creates an empty Mesh. This mesh can have an underlying geometry.
     #  @param obj the Geometrical object on which the mesh is built. If not defined,
@@ -326,8 +328,14 @@ class smeshDC(SMESH._objref_SMESH_Gen):
 
     ## Sets the current study
     #  @ingroup l1_auxiliary
-    def SetCurrentStudy( self, theStudy ):
+    def SetCurrentStudy( self, theStudy, geompyD = None ):
         #self.SetCurrentStudy(theStudy)
+       if not geompyD:
+           import geompy
+           geompyD = geompy.geom
+           pass
+        self.geompyD=geompyD
+        self.SetGeomEngine(geompyD)
         SMESH._objref_SMESH_Gen.SetCurrentStudy(self,theStudy)
 
     ## Gets the current study