]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0020702: [CEA] Problem with Segment function of SMESH module
authordmv <dmv@opencascade.com>
Mon, 15 Feb 2010 09:35:36 +0000 (09:35 +0000)
committerdmv <dmv@opencascade.com>
Mon, 15 Feb 2010 09:35:36 +0000 (09:35 +0000)
src/SMESH_SWIG/smeshDC.py

index cd769182d9988e27209938f9b91fb5cb0518330f..606b782ceda9a70b755e5fec901eb3ef65a00384 100644 (file)
@@ -390,8 +390,6 @@ def IsEqual(val1, val2, tol=PrecisionConfusion):
         return True
     return False
 
-NO_NAME = "NoName"
-
 ## Gets object name
 def GetName(obj):
     if isinstance(obj, SALOMEDS._objref_SObject):
@@ -3711,10 +3709,13 @@ class Mesh_Algorithm:
             self.geom = piece
         else:
             self.geom = geom
-            name = GetName(geom)
-            if name==NO_NAME:
+            try:
+                name = GetName(geom)
+                pass
+            except:
                 name = mesh.geompyD.SubShapeName(geom, piece)
                 mesh.geompyD.addToStudyInFather(piece, geom, name)
+                pass
             self.subm = mesh.mesh.GetSubMesh(geom, algo.GetName())
 
         self.algo = algo
@@ -4036,11 +4037,14 @@ class Mesh_Segment(Mesh_Algorithm):
         ### 0D algorithm
         if self.geom is None:
             raise RuntimeError, "Attemp to create SegmentAroundVertex_0D algoritm on None shape"
-        name = GetName(self.geom)
-        if name == NO_NAME:
+        try:
+            name = GetName(self.geom)
+            pass
+        except:
             piece = self.mesh.geom
             name = self.mesh.geompyD.SubShapeName(self.geom, piece)
             self.mesh.geompyD.addToStudyInFather(piece, self.geom, name)
+            pass
         algo = self.FindAlgorithm("SegmentAroundVertex_0D", self.mesh.smeshpyD)
         if algo is None:
             algo = self.mesh.smeshpyD.CreateHypothesis("SegmentAroundVertex_0D", "libStdMeshersEngine.so")