]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0021833: [CEA] problem with naming when exploding a step file
authorvsr <vsr@opencascade.com>
Mon, 3 Sep 2012 14:26:02 +0000 (14:26 +0000)
committervsr <vsr@opencascade.com>
Mon, 3 Sep 2012 14:26:02 +0000 (14:26 +0000)
Correct regression caused by fix for issue 0021805

src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_SWIG/geompyDC.py

index d98bec0e12cf0ee921a3c9ce0b934a5e38a7bc4a..fe877f791556c7ede77273f58b7482b28a1ffa4a 100644 (file)
@@ -748,11 +748,6 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (SALOMEDS::Study_ptr theStudy,
   aResultSO = PublishInStudy(theStudy, aResultSO, theObject, theName);
   if(aResultSO->_is_nil()) return aResultSO._retn();
 
-  // ignore internal name (for example, read from STEP file)
-  // in case of publishing from script
-  if (strlen(theName) > 0)
-    aResultSO->SetAttrString("AttributeName", theName);
-
   GEOM::ListOfGO_var aList = theObject->GetDependency();
   Standard_Integer aLength = aList->length();
   if(aLength < 1) return aResultSO._retn();
index 465f57eb6a0d7a84a533bad3e14f0d703f59ba94..acfd7a361ac5a08a118b593bd254a0b8e8b176c3 100644 (file)
@@ -486,6 +486,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             # Example: see GEOM_TestAll.py
             try:
                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
+                if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
                 if doRestoreSubShapes:
                     self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
                                             theFindMethod, theInheritFirstArg, True )
@@ -516,6 +517,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             # Example: see GEOM_TestAll.py
             try:
                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
+                if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
             except:
                 print "addToStudyInFather() failed"
                 return ""