Salome HOME
Clear data structures at Compute() finish
[modules/smesh.git] / src / SMESH_I / SMESH_MeshEditor_i.cxx
index d442601d597f747ae8c01a51930eba581c1825e6..9d1cf79dd4c24c3a1da8174e1f87f0026a321884 100644 (file)
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
 //  File   : SMESH_MeshEditor_i.cxx
 //  Author : Nicolas REJNERI
 //  Module : SMESH
-//
+
 #ifdef WNT
 #define NOMINMAX
 #endif
@@ -32,7 +31,7 @@
 #include "SMESH_MeshEditor_i.hxx"
 
 #include "SMDS_Mesh0DElement.hxx"
-#include "SMDS_MeshEdge.hxx"
+#include "SMDS_LinearEdge.hxx"
 #include "SMDS_MeshFace.hxx"
 #include "SMDS_MeshVolume.hxx"
 #include "SMDS_PolyhedralVolumeOfNodes.hxx"
@@ -134,11 +133,11 @@ namespace {
       SMDS_MeshElement* anElemCopy = 0;
       if ( anElem->IsPoly() && anElem->GetType() == SMDSAbs_Volume )
       {
-        const SMDS_PolyhedralVolumeOfNodes* ph =
-          dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem);
+        const SMDS_VtkVolume* ph =
+          dynamic_cast<const SMDS_VtkVolume*> (anElem);
         if ( ph )
           anElemCopy = _myMeshDS->AddPolyhedralVolumeWithID
-            (anElemNodesID, ph->GetQuanities(),anElem->GetID());
+            (anElemNodesID, ph->GetQuantities(),anElem->GetID());
       }
       else {
         anElemCopy = ::SMESH_MeshEditor(this).AddElement( anElemNodesID,
@@ -150,7 +149,7 @@ namespace {
     //!< Copy a node
     SMDS_MeshNode* Copy( const SMDS_MeshNode* anElemNode )
     {
-      return _myMeshDS->AddNodeWithID(anElemNode->X(), anElemNode->Y(), anElemNode->Z(), 
+      return _myMeshDS->AddNodeWithID(anElemNode->X(), anElemNode->Y(), anElemNode->Z(),
                                       anElemNode->GetID());
     }
   };// struct TPreviewMesh
@@ -416,11 +415,12 @@ SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements)
   // Update Python script
   TPythonDump() << "isDone = " << this << ".RemoveElements( " << IDsOfElements << " )";
 
+  // Remove Elements
+  bool ret = anEditor.Remove( IdList, false );
+  myMesh->GetMeshDS()->Modified();
   if ( IDsOfElements.length() )
     myMesh->SetIsModified( true ); // issue 0020693
-
-  // Remove Elements
-  return anEditor.Remove( IdList, false );
+  return ret;
 }
 
 //=============================================================================
@@ -441,10 +441,11 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNo
   // Update Python script
   TPythonDump() << "isDone = " << this << ".RemoveNodes( " << IDsOfNodes << " )";
 
+  bool ret = anEditor.Remove( IdList, true );
+  myMesh->GetMeshDS()->Modified();
   if ( IDsOfNodes.length() )
     myMesh->SetIsModified( true ); // issue 0020693
-
-  return anEditor.Remove( IdList, true );
+  return ret;
 }
 
 //=============================================================================
@@ -472,10 +473,12 @@ CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes()
   for ( int i = 0; i < seq.size(); i++ )
     IdList.push_back( seq[i] );
 
+  bool ret = anEditor.Remove( IdList, true );
+  myMesh->GetMeshDS()->Modified();
   if ( IdList.size() )
     myMesh->SetIsModified( true );
 
-  return anEditor.Remove( IdList, true );
+  return ret;
 }
 
 //=============================================================================
@@ -495,8 +498,8 @@ CORBA::Long SMESH_MeshEditor_i::AddNode(CORBA::Double x,
   TPythonDump() << "nodeID = " << this << ".AddNode( "
                 << x << ", " << y << ", " << z << " )";
 
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true ); // issue 0020693
-
   return N->GetID();
 }
 
@@ -515,6 +518,7 @@ CORBA::Long SMESH_MeshEditor_i::Add0DElement(CORBA::Long IDOfNode)
   // Update Python script
   TPythonDump() << "elem0d = " << this << ".Add0DElement( " << IDOfNode <<" )";
 
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true ); // issue 0020693
 
   if (elem)
@@ -557,6 +561,7 @@ CORBA::Long SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes)
                   <<n1<<", "<<n2<<", "<<n12<<" ])";
   }
 
+  myMesh->GetMeshDS()->Modified();
   if(elem)
     return myMesh->SetIsModified( true ), elem->GetID();
 
@@ -605,6 +610,7 @@ CORBA::Long SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes)
   // Update Python script
   TPythonDump() << "faceID = " << this << ".AddFace( " << IDsOfNodes << " )";
 
+  myMesh->GetMeshDS()->Modified();
   if(elem)
     return myMesh->SetIsModified( true ), elem->GetID();
 
@@ -630,6 +636,7 @@ CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace (const SMESH::long_array & IDsO
   // Update Python script
   TPythonDump() <<"faceID = "<<this<<".AddPolygonalFace( "<<IDsOfNodes<<" )";
 
+  myMesh->GetMeshDS()->Modified();
   return elem ? ( myMesh->SetIsModified( true ), elem->GetID()) : 0;
 }
 
@@ -673,6 +680,7 @@ CORBA::Long SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes)
   // Update Python script
   TPythonDump() << "volID = " << this << ".AddVolume( " << IDsOfNodes << " )";
 
+  myMesh->GetMeshDS()->Modified();
   if(elem)
     return myMesh->SetIsModified( true ), elem->GetID();
 
@@ -692,7 +700,11 @@ CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::long_array & I
   int NbNodes = IDsOfNodes.length();
   std::vector<const SMDS_MeshNode*> n (NbNodes);
   for (int i = 0; i < NbNodes; i++)
-    n[i] = GetMeshDS()->FindNode(IDsOfNodes[i]);
+    {
+      const SMDS_MeshNode* aNode = GetMeshDS()->FindNode(IDsOfNodes[i]);
+      if (!aNode) return 0;
+      n[i] = aNode;
+    }
 
   int NbFaces = Quantities.length();
   std::vector<int> q (NbFaces);
@@ -704,6 +716,7 @@ CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::long_array & I
   // Update Python script
   TPythonDump() << "volID = " << this << ".AddPolyhedralVolume( "
                 << IDsOfNodes << ", " << Quantities << " )";
+  myMesh->GetMeshDS()->Modified();
 
   return elem ? ( myMesh->SetIsModified( true ), elem->GetID()) : 0;
 }
@@ -736,6 +749,7 @@ CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces (const SMESH::long_ar
   // Update Python script
   TPythonDump() << "volID = " << this << ".AddPolyhedralVolumeByFaces( "
                 << IdsOfFaces << " )";
+  myMesh->GetMeshDS()->Modified();
 
   return elem ? ( myMesh->SetIsModified( true ), elem->GetID()) : 0;
 }
@@ -847,16 +861,15 @@ void SMESH_MeshEditor_i::SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
   if ( isOut ) {
 #ifdef _DEBUG_
     MESSAGE ( "FACE " << FaceID << " (" << u << "," << v << ") out of "
-              << " u( " <<  surf.FirstUParameter() 
-              << "," <<  surf.LastUParameter()  
-              << ") v( " <<  surf.FirstVParameter() 
+              << " u( " <<  surf.FirstUParameter()
+              << "," <<  surf.LastUParameter()
+              << ") v( " <<  surf.FirstVParameter()
               << "," <<  surf.LastVParameter() << ")" );
-#endif    
+#endif
     THROW_SALOME_CORBA_EXCEPTION("Invalid UV", SALOME::BAD_PARAM);
   }
 
   mesh->SetNodeOnFace( node, FaceID, u, v );
-
   myMesh->SetIsModified( true );
 }
 
@@ -947,10 +960,12 @@ CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(CORBA::Long NodeID1,
   TPythonDump() << "isDone = " << this << ".InverseDiag( "
                 << NodeID1 << ", " << NodeID2 << " )";
 
-  myMesh->SetIsModified( true );
 
   ::SMESH_MeshEditor aMeshEditor( myMesh );
-  return aMeshEditor.InverseDiag ( n1, n2 );
+  int ret =  aMeshEditor.InverseDiag ( n1, n2 );
+  myMesh->GetMeshDS()->Modified();
+  myMesh->SetIsModified( true );
+  return ret;
 }
 
 //=============================================================================
@@ -977,9 +992,10 @@ CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(CORBA::Long NodeID1,
 
   bool stat = aMeshEditor.DeleteDiag ( n1, n2 );
 
+  myMesh->GetMeshDS()->Modified();
   if ( stat )
     myMesh->SetIsModified( true ); // issue 0020693
-    
+
   storeResult(aMeshEditor);
 
   return stat;
@@ -1006,6 +1022,7 @@ CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfEleme
   // Update Python script
   TPythonDump() << "isDone = " << this << ".Reorient( " << IDsOfElements << " )";
 
+  myMesh->GetMeshDS()->Modified();
   if ( IDsOfElements.length() )
     myMesh->SetIsModified( true ); // issue 0020693
 
@@ -1064,6 +1081,7 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array &   IDsOfE
   ::SMESH_MeshEditor anEditor( myMesh );
 
   bool stat = anEditor.TriToQuad( faces, aCrit, MaxAngle );
+  myMesh->GetMeshDS()->Modified();
   if ( stat )
     myMesh->SetIsModified( true ); // issue 0020693
 
@@ -1127,6 +1145,7 @@ CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::long_array &   IDsOfE
 
   ::SMESH_MeshEditor anEditor( myMesh );
   CORBA::Boolean stat = anEditor.QuadToTri( faces, aCrit );
+  myMesh->GetMeshDS()->Modified();
   if ( stat )
     myMesh->SetIsModified( true ); // issue 0020693
 
@@ -1181,6 +1200,7 @@ CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::long_array & IDsOfEle
 
   ::SMESH_MeshEditor anEditor( myMesh );
   CORBA::Boolean stat = anEditor.QuadToTri( faces, Diag13 );
+  myMesh->GetMeshDS()->Modified();
   if ( stat )
     myMesh->SetIsModified( true ); // issue 0020693
 
@@ -1258,9 +1278,10 @@ void SMESH_MeshEditor_i::SplitVolumesIntoTetra (SMESH::SMESH_IDSource_ptr elems,
   SMESH::long_array_var anElementsId = elems->GetIDs();
   TIDSortedElemSet elemSet;
   arrayToSet( anElementsId, GetMeshDS(), elemSet, SMDSAbs_Volume );
-  
+
   ::SMESH_MeshEditor anEditor (myMesh);
   anEditor.SplitVolumesIntoTetra( elemSet, int( methodFlags ));
+  myMesh->GetMeshDS()->Modified();
 
   storeResult(anEditor);
 
@@ -1375,6 +1396,7 @@ SMESH_MeshEditor_i::smooth(const SMESH::long_array &              IDsOfElements,
   anEditor.Smooth(elements, fixedNodes, method,
                   MaxNbOfIterations, MaxAspectRatio, IsParametric );
 
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true ); // issue 0020693
 
   storeResult(anEditor);
@@ -1472,7 +1494,7 @@ SMESH::ListOfGroups* SMESH_MeshEditor_i::getGroups(const std::list<int>* groupID
 
 //=======================================================================
 //function : rotationSweep
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1514,6 +1536,7 @@ SMESH_MeshEditor_i::rotationSweep(const SMESH::long_array & theIDsOfElements,
       anEditor.RotationSweep (*workElements, Ax1, theAngleInRadians,
                               theNbOfSteps, theTolerance, theMakeGroups, makeWalls);
   storeResult(anEditor);
+  myMesh->GetMeshDS()->Modified();
 
   //  myMesh->SetIsModified( true ); -- it does not influence Compute()
 
@@ -1549,7 +1572,7 @@ void SMESH_MeshEditor_i::RotationSweep(const SMESH::long_array & theIDsOfElement
 
 //=======================================================================
 //function : RotationSweepMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1559,21 +1582,22 @@ SMESH_MeshEditor_i::RotationSweepMakeGroups(const SMESH::long_array& theIDsOfEle
                                             CORBA::Long              theNbOfSteps,
                                             CORBA::Double            theTolerance)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups *aGroups = rotationSweep(theIDsOfElements,
                                                theAxis,
                                                theAngleInRadians,
                                                theNbOfSteps,
                                                theTolerance,
                                                true);
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
-    aPythonDump<< this << ".RotationSweepMakeGroups( "
-               << theIDsOfElements << ", "
-               << theAxis << ", "
-               << theAngleInRadians << ", "
-               << theNbOfSteps << ", "
-               << theTolerance << " )";
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
+    aPythonDump << this << ".RotationSweepMakeGroups( "
+                << theIDsOfElements << ", "
+                << theAxis << ", "
+                << theAngleInRadians << ", "
+                << theNbOfSteps << ", "
+                << theTolerance << " )";
   }
   return aGroups;
 }
@@ -1666,7 +1690,7 @@ void SMESH_MeshEditor_i::RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObje
 
 //=======================================================================
 //function : RotationSweepObjectMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1676,6 +1700,8 @@ SMESH_MeshEditor_i::RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr theO
                                                   CORBA::Long               theNbOfSteps,
                                                   CORBA::Double             theTolerance)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
                                                theAxis,
@@ -1683,22 +1709,21 @@ SMESH_MeshEditor_i::RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr theO
                                                theNbOfSteps,
                                                theTolerance,
                                                true);
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
-    aPythonDump<< this << ".RotationSweepObjectMakeGroups( "
-               << theObject << ", "
-               << theAxis << ", "
-               << theAngleInRadians << ", "
-               << theNbOfSteps << ", "
-               << theTolerance << " )";
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
+    aPythonDump << this << ".RotationSweepObjectMakeGroups( "
+                << theObject << ", "
+                << theAxis << ", "
+                << theAngleInRadians << ", "
+                << theNbOfSteps << ", "
+                << theTolerance << " )";
   }
   return aGroups;
 }
 
 //=======================================================================
 //function : RotationSweepObject1DMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1708,6 +1733,8 @@ SMESH_MeshEditor_i::RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr th
                                                     CORBA::Long               theNbOfSteps,
                                                     CORBA::Double             theTolerance)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
                                                theAxis,
@@ -1716,22 +1743,21 @@ SMESH_MeshEditor_i::RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr th
                                                theTolerance,
                                                true,
                                                SMDSAbs_Edge);
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
-    aPythonDump<< this << ".RotationSweepObject1DMakeGroups( "
-               << theObject << ", "
-               << theAxis << ", "
-               << theAngleInRadians << ", "
-               << theNbOfSteps << ", "
-               << theTolerance << " )";
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
+    aPythonDump << this << ".RotationSweepObject1DMakeGroups( "
+                << theObject << ", "
+                << theAxis << ", "
+                << theAngleInRadians << ", "
+                << theNbOfSteps << ", "
+                << theTolerance << " )";
   }
   return aGroups;
 }
 
 //=======================================================================
 //function : RotationSweepObject2DMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1741,6 +1767,8 @@ SMESH_MeshEditor_i::RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr th
                                                     CORBA::Long               theNbOfSteps,
                                                     CORBA::Double             theTolerance)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
                                                theAxis,
@@ -1749,15 +1777,14 @@ SMESH_MeshEditor_i::RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr th
                                                theTolerance,
                                                true,
                                                SMDSAbs_Face);
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
-    aPythonDump<< this << ".RotationSweepObject2DMakeGroups( "
-               << theObject << ", "
-               << theAxis << ", "
-               << theAngleInRadians << ", "
-               << theNbOfSteps << ", "
-               << theTolerance << " )";
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
+    aPythonDump << this << ".RotationSweepObject2DMakeGroups( "
+                << theObject << ", "
+                << theAxis << ", "
+                << theAngleInRadians << ", "
+                << theNbOfSteps << ", "
+                << theTolerance << " )";
   }
   return aGroups;
 }
@@ -1765,7 +1792,7 @@ SMESH_MeshEditor_i::RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr th
 
 //=======================================================================
 //function : extrusionSweep
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1777,7 +1804,7 @@ SMESH_MeshEditor_i::extrusionSweep(const SMESH::long_array & theIDsOfElements,
 {
   initData();
 
-  try {   
+  try {
 #ifdef NO_CAS_CATCH
     OCC_CATCH_SIGNALS;
 #endif
@@ -1792,12 +1819,13 @@ SMESH_MeshEditor_i::extrusionSweep(const SMESH::long_array & theIDsOfElements,
     ::SMESH_MeshEditor::PGroupIDs groupIds =
         anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory, theMakeGroups);
 
+    myMesh->GetMeshDS()->Modified();
     storeResult(anEditor);
 
     return theMakeGroups ? getGroups(groupIds.get()) : 0;
 
   } catch(Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();          
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() );
   }
   return 0;
@@ -1813,7 +1841,7 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
                                         CORBA::Long               theNbOfSteps)
 {
   extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false );
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     TPythonDump() << this << ".ExtrusionSweep( "
                   << theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
   }
@@ -1831,7 +1859,7 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObjec
 {
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false );
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     TPythonDump() << this << ".ExtrusionSweepObject( "
                   << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
@@ -1873,7 +1901,7 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObj
 
 //=======================================================================
 //function : ExtrusionSweepMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1881,19 +1909,21 @@ SMESH_MeshEditor_i::ExtrusionSweepMakeGroups(const SMESH::long_array& theIDsOfEl
                                              const SMESH::DirStruct&  theStepVector,
                                              CORBA::Long              theNbOfSteps)
 {
-  SMESH::ListOfGroups* aGroups = extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, true );
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
 
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
-    aPythonDump  << this << ".ExtrusionSweepMakeGroups( "
-                 << theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
+  SMESH::ListOfGroups* aGroups = extrusionSweep(theIDsOfElements, theStepVector, theNbOfSteps, true);
+
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
+    aPythonDump << this << ".ExtrusionSweepMakeGroups( " << theIDsOfElements
+                << ", " << theStepVector <<", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
+
 //=======================================================================
 //function : ExtrusionSweepObjectMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1901,21 +1931,22 @@ SMESH_MeshEditor_i::ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr the
                                                    const SMESH::DirStruct&   theStepVector,
                                                    CORBA::Long               theNbOfSteps)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = theObject->GetIDs();
-  SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true );
+  SMESH::ListOfGroups * aGroups = extrusionSweep(anElementsId, theStepVector, theNbOfSteps, true);
 
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
-    aPythonDump<< this << ".ExtrusionSweepObjectMakeGroups( "
-               << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
+    aPythonDump << this << ".ExtrusionSweepObjectMakeGroups( " << theObject
+                << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
 
 //=======================================================================
 //function : ExtrusionSweepObject1DMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1923,20 +1954,22 @@ SMESH_MeshEditor_i::ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr t
                                                      const SMESH::DirStruct&   theStepVector,
                                                      CORBA::Long               theNbOfSteps)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = theObject->GetIDs();
-  SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Edge );
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
-    aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( "
-                << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+  SMESH::ListOfGroups * aGroups = extrusionSweep(anElementsId, theStepVector,
+                                                 theNbOfSteps, true, SMDSAbs_Edge);
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
+    aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( " << theObject
+                << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
 
 //=======================================================================
 //function : ExtrusionSweepObject2DMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -1944,13 +1977,15 @@ SMESH_MeshEditor_i::ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr t
                                                      const SMESH::DirStruct&   theStepVector,
                                                      CORBA::Long               theNbOfSteps)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = theObject->GetIDs();
-  SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Face );
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
-    aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( "
-                << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+  SMESH::ListOfGroups * aGroups = extrusionSweep(anElementsId, theStepVector,
+                                                 theNbOfSteps, true, SMDSAbs_Face);
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
+    aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( " << theObject
+                << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
@@ -1958,7 +1993,7 @@ SMESH_MeshEditor_i::ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr t
 
 //=======================================================================
 //function : advancedExtrusion
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -2017,9 +2052,8 @@ void SMESH_MeshEditor_i::AdvancedExtrusion(const SMESH::long_array & theIDsOfEle
 
 //=======================================================================
 //function : AdvancedExtrusionMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
-
 SMESH::ListOfGroups*
 SMESH_MeshEditor_i::AdvancedExtrusionMakeGroups(const SMESH::long_array& theIDsOfElements,
                                                 const SMESH::DirStruct&  theStepVector,
@@ -2027,6 +2061,11 @@ SMESH_MeshEditor_i::AdvancedExtrusionMakeGroups(const SMESH::long_array& theIDsO
                                                 CORBA::Long              theExtrFlags,
                                                 CORBA::Double            theSewTolerance)
 {
+  if (!myPreviewMode) {
+    TPythonDump() << "stepVector = " << theStepVector;
+  }
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups * aGroups = advancedExtrusion( theIDsOfElements,
                                                      theStepVector,
                                                      theNbOfSteps,
@@ -2034,10 +2073,8 @@ SMESH_MeshEditor_i::AdvancedExtrusionMakeGroups(const SMESH::long_array& theIDsO
                                                      theSewTolerance,
                                                      true);
 
-  if ( !myPreviewMode ) {
-    TPythonDump() << "stepVector = " << theStepVector;
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
     aPythonDump << this << ".AdvancedExtrusionMakeGroups("
                 << theIDsOfElements
                 << ", stepVector, "
@@ -2074,9 +2111,8 @@ static SMESH::SMESH_MeshEditor::Extrusion_Error convExtrError( const::SMESH_Mesh
 
 //=======================================================================
 //function : extrusionAlongPath
-//purpose  : 
+//purpose  :
 //=======================================================================
-
 SMESH::ListOfGroups*
 SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array &   theIDsOfElements,
                                        SMESH::SMESH_Mesh_ptr       thePathMesh,
@@ -2090,6 +2126,7 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array &   theIDsOfEleme
                                        SMESH::SMESH_MeshEditor::Extrusion_Error & theError,
                                        const SMDSAbs_ElementType   theElementType)
 {
+  MESSAGE("extrusionAlongPath");
   initData();
 
   if ( thePathMesh->_is_nil() || thePathShape->_is_nil() ) {
@@ -2129,6 +2166,7 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array &   theIDsOfEleme
       anEditor.ExtrusionAlongTrack( elements, aSubMesh, nodeStart,
                                     theHasAngles, angles, false,
                                     theHasRefPoint, refPnt, theMakeGroups );
+  myMesh->GetMeshDS()->Modified();
   storeResult(anEditor);
   theError = convExtrError( error );
 
@@ -2145,9 +2183,8 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array &   theIDsOfEleme
 
 //=======================================================================
 //function : extrusionAlongPathX
-//purpose  : 
+//purpose  :
 //=======================================================================
-
 SMESH::ListOfGroups*
 SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array &  IDsOfElements,
                                         SMESH::SMESH_IDSource_ptr  Path,
@@ -2186,7 +2223,7 @@ SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array &  IDsOfElements
   SMESH_Mesh_i* aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( Path );
   if(aMeshImp) {
     // path as mesh
-    SMDS_MeshNode* aNodeStart = 
+    SMDS_MeshNode* aNodeStart =
       (SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(NodeStart);
     if ( !aNodeStart ) {
       Error = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
@@ -2195,6 +2232,7 @@ SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array &  IDsOfElements
     error = anEditor.ExtrusionAlongTrack( elements, &(aMeshImp->GetImpl()), aNodeStart,
                                           HasAngles, angles, LinearVariation,
                                           HasRefPoint, refPnt, MakeGroups );
+    myMesh->GetMeshDS()->Modified();
   }
   else {
     SMESH_subMesh_i* aSubMeshImp = SMESH::DownCast<SMESH_subMesh_i*>( Path );
@@ -2202,17 +2240,18 @@ SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array &  IDsOfElements
       // path as submesh
       SMESH::SMESH_Mesh_ptr aPathMesh = aSubMeshImp->GetFather();
       aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( aPathMesh );
-      SMDS_MeshNode* aNodeStart = 
+      SMDS_MeshNode* aNodeStart =
         (SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(NodeStart);
       if ( !aNodeStart ) {
         Error = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
         return EmptyGr;
       }
-      SMESH_subMesh* aSubMesh = 
+      SMESH_subMesh* aSubMesh =
         aMeshImp->GetImpl().GetSubMeshContaining(aSubMeshImp->GetId());
       error = anEditor.ExtrusionAlongTrack( elements, aSubMesh, aNodeStart,
                                             HasAngles, angles, LinearVariation,
                                             HasRefPoint, refPnt, MakeGroups );
+      myMesh->GetMeshDS()->Modified();
     }
     else {
       SMESH_Group_i* aGroupImp = SMESH::DownCast<SMESH_Group_i*>( Path );
@@ -2245,7 +2284,6 @@ SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array &  IDsOfElements
 //function : ExtrusionAlongPath
 //purpose  :
 //=======================================================================
-
 SMESH::SMESH_MeshEditor::Extrusion_Error
 SMESH_MeshEditor_i::ExtrusionAlongPath(const SMESH::long_array &   theIDsOfElements,
                                        SMESH::SMESH_Mesh_ptr       thePathMesh,
@@ -2256,6 +2294,7 @@ SMESH_MeshEditor_i::ExtrusionAlongPath(const SMESH::long_array &   theIDsOfEleme
                                        CORBA::Boolean              theHasRefPoint,
                                        const SMESH::PointStruct &  theRefPoint)
 {
+  MESSAGE("ExtrusionAlongPath");
   if ( !myPreviewMode ) {
     TPythonDump() << "error = " << this << ".ExtrusionAlongPath( "
                   << theIDsOfElements << ", "
@@ -2288,7 +2327,6 @@ SMESH_MeshEditor_i::ExtrusionAlongPath(const SMESH::long_array &   theIDsOfEleme
 //function : ExtrusionAlongPathObject
 //purpose  :
 //=======================================================================
-
 SMESH::SMESH_MeshEditor::Extrusion_Error
 SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
                                              SMESH::SMESH_Mesh_ptr       thePathMesh,
@@ -2332,7 +2370,6 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObje
 //function : ExtrusionAlongPathObject1D
 //purpose  :
 //=======================================================================
-
 SMESH::SMESH_MeshEditor::Extrusion_Error
 SMESH_MeshEditor_i::ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
                                                SMESH::SMESH_Mesh_ptr       thePathMesh,
@@ -2377,7 +2414,6 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theOb
 //function : ExtrusionAlongPathObject2D
 //purpose  :
 //=======================================================================
-
 SMESH::SMESH_MeshEditor::Extrusion_Error
 SMESH_MeshEditor_i::ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
                                                SMESH::SMESH_Mesh_ptr       thePathMesh,
@@ -2421,9 +2457,8 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theOb
 
 //=======================================================================
 //function : ExtrusionAlongPathMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
-
 SMESH::ListOfGroups*
 SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array&   theIDsOfElements,
                                                  SMESH::SMESH_Mesh_ptr      thePathMesh,
@@ -2435,6 +2470,8 @@ SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array&   theI
                                                  const SMESH::PointStruct&  theRefPoint,
                                                  SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups * aGroups =  extrusionAlongPath( theIDsOfElements,
                                                        thePathMesh,
                                                        thePathShape,
@@ -2445,14 +2482,10 @@ SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array&   theI
                                                        theRefPoint,
                                                        true,
                                                        Error);
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
-    TPythonDump aPythonDump;
-    if(isDumpGroups) {
-      aPythonDump << "("<<aGroups;
-    }
-    if(isDumpGroups)
-      aPythonDump << ", error)";
+    if (isDumpGroups)
+      aPythonDump << "(" << aGroups << ", error)";
     else
       aPythonDump <<"error";
 
@@ -2474,9 +2507,8 @@ SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array&   theI
 
 //=======================================================================
 //function : ExtrusionAlongPathObjectMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
-
 SMESH::ListOfGroups* SMESH_MeshEditor_i::
 ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                    SMESH::SMESH_Mesh_ptr      thePathMesh,
@@ -2488,6 +2520,8 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                    const SMESH::PointStruct&  theRefPoint,
                                    SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
                                                       thePathMesh,
@@ -2500,14 +2534,10 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                                       true,
                                                       Error);
 
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
-    TPythonDump aPythonDump;
-    if(isDumpGroups) {
-      aPythonDump << "("<<aGroups;
-    }
-    if(isDumpGroups)
-      aPythonDump << ", error)";
+    if (isDumpGroups)
+      aPythonDump << "(" << aGroups << ", error)";
     else
       aPythonDump <<"error";
 
@@ -2529,9 +2559,8 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
 
 //=======================================================================
 //function : ExtrusionAlongPathObject1DMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
-
 SMESH::ListOfGroups* SMESH_MeshEditor_i::
 ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                      SMESH::SMESH_Mesh_ptr      thePathMesh,
@@ -2543,6 +2572,8 @@ ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                      const SMESH::PointStruct&  theRefPoint,
                                      SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
                                                       thePathMesh,
@@ -2556,16 +2587,12 @@ ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                                       Error,
                                                       SMDSAbs_Edge);
 
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
-    TPythonDump aPythonDump;
-    if(isDumpGroups) {
-      aPythonDump << "("<<aGroups;
-    }
-    if(isDumpGroups)
-      aPythonDump << ", error)";
+    if (isDumpGroups)
+      aPythonDump << "(" << aGroups << ", error)";
     else
-      aPythonDump <<"error";
+      aPythonDump << "error";
 
     aPythonDump << " = " << this << ".ExtrusionAlongPathObject1DMakeGroups( "
                 << theObject << ", "
@@ -2585,9 +2612,8 @@ ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
 
 //=======================================================================
 //function : ExtrusionAlongPathObject2DMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
-
 SMESH::ListOfGroups* SMESH_MeshEditor_i::
 ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                      SMESH::SMESH_Mesh_ptr      thePathMesh,
@@ -2599,6 +2625,8 @@ ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                      const SMESH::PointStruct&  theRefPoint,
                                      SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
                                                       thePathMesh,
@@ -2612,16 +2640,12 @@ ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                                       Error,
                                                       SMDSAbs_Face);
 
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
-    TPythonDump aPythonDump;
-    if(isDumpGroups) {
-      aPythonDump << "("<<aGroups;
-    }
-    if(isDumpGroups)
-      aPythonDump << ", error)";
+    if (isDumpGroups)
+      aPythonDump << "(" << aGroups << ", error)";
     else
-      aPythonDump <<"error";
+      aPythonDump << "error";
 
     aPythonDump << " = " << this << ".ExtrusionAlongPathObject2DMakeGroups( "
                 << theObject << ", "
@@ -2642,7 +2666,7 @@ ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
 
 //=======================================================================
 //function : ExtrusionAlongPathObjX
-//purpose  : 
+//purpose  :
 //=======================================================================
 SMESH::ListOfGroups* SMESH_MeshEditor_i::
 ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
@@ -2657,6 +2681,8 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
                        SMESH::ElementType         ElemType,
                        SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::long_array_var anElementsId = Object->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionAlongPathX(anElementsId,
                                                       Path,
@@ -2670,16 +2696,12 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
                                                       (SMDSAbs_ElementType)ElemType,
                                                       Error);
 
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
-    TPythonDump aPythonDump;
-    if(isDumpGroups) {
-      aPythonDump << "("<<aGroups;
-    }
-    if(isDumpGroups)
-      aPythonDump << ", error)";
+    if (isDumpGroups)
+      aPythonDump << "(" << *aGroups << ", error)";
     else
-      aPythonDump <<"error";
+      aPythonDump << "error";
 
     aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( "
                 << Object      << ", "
@@ -2702,7 +2724,7 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
 
 //=======================================================================
 //function : ExtrusionAlongPathX
-//purpose  : 
+//purpose  :
 //=======================================================================
 SMESH::ListOfGroups* SMESH_MeshEditor_i::
 ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
@@ -2717,6 +2739,8 @@ ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
                     SMESH::ElementType         ElemType,
                     SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups * aGroups = extrusionAlongPathX(IDsOfElements,
                                                       Path,
                                                       NodeStart,
@@ -2729,14 +2753,10 @@ ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
                                                       (SMDSAbs_ElementType)ElemType,
                                                       Error);
 
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
-    TPythonDump aPythonDump;
-    if(isDumpGroups) {
-      aPythonDump << "("<<aGroups;
-    }
-    if(isDumpGroups)
-      aPythonDump << ", error)";
+    if (isDumpGroups)
+      aPythonDump << "(" << *aGroups << ", error)";
     else
       aPythonDump <<"error";
 
@@ -2752,6 +2772,7 @@ ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
                 << ( HasRefPoint ? RefPoint.x : 0 ) << ", "
                 << ( HasRefPoint ? RefPoint.y : 0 ) << ", "
                 << ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
+                << MakeGroups << ", "
                 << ElemType << " )";
   }
   return aGroups;
@@ -2762,9 +2783,9 @@ ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
 /*!
  * \brief Compute rotation angles for ExtrusionAlongPath as linear variation
  * of given angles along path steps
- * \param PathMesh mesh containing a 1D sub-mesh on the edge, along 
+ * \param PathMesh mesh containing a 1D sub-mesh on the edge, along
  *                which proceeds the extrusion
- * \param PathShape is shape(edge); as the mesh can be complex, the edge 
+ * \param PathShape is shape(edge); as the mesh can be complex, the edge
  *                 is used to define the sub-mesh for the path
  */
 //================================================================================
@@ -2832,7 +2853,7 @@ SMESH_MeshEditor_i::LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       thePathMes
 
 //=======================================================================
 //function : mirror
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -2867,7 +2888,10 @@ SMESH_MeshEditor_i::mirror(TIDSortedElemSet &                  theElements,
   if(theCopy)
     storeResult(anEditor);
   else
-    myMesh->SetIsModified( true );
+    {
+      myMesh->GetMeshDS()->Modified();
+      myMesh->SetIsModified( true );
+    }
 
   return theMakeGroups ? getGroups(groupIds.get()) : 0;
 }
@@ -2922,7 +2946,7 @@ void SMESH_MeshEditor_i::MirrorObject(SMESH::SMESH_IDSource_ptr           theObj
 
 //=======================================================================
 //function : MirrorMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -2930,6 +2954,8 @@ SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::long_array&            theIDsO
                                      const SMESH::AxisStruct&            theMirror,
                                      SMESH::SMESH_MeshEditor::MirrorType theMirrorType)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups * aGroups = 0;
   if ( theIDsOfElements.length() > 0 )
   {
@@ -2937,9 +2963,8 @@ SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::long_array&            theIDsO
     arrayToSet(theIDsOfElements, GetMeshDS(), elements);
     aGroups = mirror(elements, theMirror, theMirrorType, true, true);
   }
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
     aPythonDump << this << ".MirrorMakeGroups( "
                 << theIDsOfElements << ", "
                 << theMirror << ", "
@@ -2950,7 +2975,7 @@ SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::long_array&            theIDsO
 
 //=======================================================================
 //function : MirrorObjectMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -2958,14 +2983,15 @@ SMESH_MeshEditor_i::MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           t
                                            const SMESH::AxisStruct&            theMirror,
                                            SMESH::SMESH_MeshEditor::MirrorType theMirrorType)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups * aGroups = 0;
   TIDSortedElemSet elements;
   if ( idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
     aGroups = mirror(elements, theMirror, theMirrorType, true, true);
 
-  if ( !myPreviewMode )
+  if (!myPreviewMode)
   {
-    TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".MirrorObjectMakeGroups( "
                 << theObject << ", "
@@ -2977,7 +3003,7 @@ SMESH_MeshEditor_i::MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           t
 
 //=======================================================================
 //function : MirrorMakeMesh
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::SMESH_Mesh_ptr
@@ -3005,7 +3031,7 @@ SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::long_array&            theIDsOfE
       mesh_i->CreateGroupServants();
     }
 
-    if ( !myPreviewMode ) {
+    if (!myPreviewMode) {
       pydump << mesh << " = " << this << ".MirrorMakeMesh( "
              << theIDsOfElements << ", "
              << theMirror   << ", "
@@ -3016,7 +3042,7 @@ SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::long_array&            theIDsOfE
   }
 
   //dump "GetGroups"
-  if(!myPreviewMode && mesh_i)
+  if (!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
 
   return mesh._retn();
@@ -3024,7 +3050,7 @@ SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::long_array&            theIDsOfE
 
 //=======================================================================
 //function : MirrorObjectMakeMesh
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::SMESH_Mesh_ptr
@@ -3051,7 +3077,7 @@ SMESH_MeshEditor_i::MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           the
              false, theCopyGroups, & mesh_i->GetImpl());
       mesh_i->CreateGroupServants();
     }
-    if ( !myPreviewMode ) {
+    if (!myPreviewMode) {
       pydump << mesh << " = " << this << ".MirrorObjectMakeMesh( "
              << theObject << ", "
              << theMirror   << ", "
@@ -3062,7 +3088,7 @@ SMESH_MeshEditor_i::MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           the
   }
 
   //dump "GetGroups"
-  if(!myPreviewMode && mesh_i)
+  if (!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
 
   return mesh._retn();
@@ -3070,7 +3096,7 @@ SMESH_MeshEditor_i::MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           the
 
 //=======================================================================
 //function : translate
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -3093,7 +3119,10 @@ SMESH_MeshEditor_i::translate(TIDSortedElemSet        & theElements,
   if(theCopy)
     storeResult(anEditor);
   else
-    myMesh->SetIsModified( true );
+    {
+      myMesh->GetMeshDS()->Modified();
+      myMesh->SetIsModified( true );
+    }
 
   return theMakeGroups ? getGroups(groupIds.get()) : 0;
 }
@@ -3107,17 +3136,16 @@ void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements,
                                    const SMESH::DirStruct &  theVector,
                                    CORBA::Boolean            theCopy)
 {
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     TPythonDump() << this << ".Translate( "
                   << theIDsOfElements << ", "
                   << theVector << ", "
                   << theCopy << " )";
   }
-  if ( theIDsOfElements.length() )
-  {
+  if (theIDsOfElements.length()) {
     TIDSortedElemSet elements;
     arrayToSet(theIDsOfElements, GetMeshDS(), elements);
-    translate(elements,theVector,theCopy,false);
+    translate(elements, theVector, theCopy, false);
   }
 }
 
@@ -3130,36 +3158,36 @@ void SMESH_MeshEditor_i::TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
                                          const SMESH::DirStruct &  theVector,
                                          CORBA::Boolean            theCopy)
 {
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     TPythonDump() << this << ".TranslateObject( "
                   << theObject << ", "
                   << theVector << ", "
                   << theCopy << " )";
   }
   TIDSortedElemSet elements;
-  if ( idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
-    translate( elements, theVector, theCopy, false);
+  if (idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
+    translate(elements, theVector, theCopy, false);
 }
 
 //=======================================================================
 //function : TranslateMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
 SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::long_array& theIDsOfElements,
                                         const SMESH::DirStruct&  theVector)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups * aGroups = 0;
-  if ( theIDsOfElements.length() )
-  {
+  if (theIDsOfElements.length()) {
     TIDSortedElemSet elements;
     arrayToSet(theIDsOfElements, GetMeshDS(), elements);
     aGroups = translate(elements,theVector,true,true);
   }
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
     aPythonDump << this << ".TranslateMakeGroups( "
                 << theIDsOfElements << ", "
                 << theVector << " )";
@@ -3169,22 +3197,22 @@ SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::long_array& theIDsOfElement
 
 //=======================================================================
 //function : TranslateObjectMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
 SMESH_MeshEditor_i::TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
                                               const SMESH::DirStruct&   theVector)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups * aGroups = 0;
   TIDSortedElemSet elements;
   if (idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
     aGroups = translate(elements, theVector, true, true);
 
-  if ( !myPreviewMode ) {
-
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
     aPythonDump << this << ".TranslateObjectMakeGroups( "
                 << theObject << ", "
                 << theVector << " )";
@@ -3194,7 +3222,7 @@ SMESH_MeshEditor_i::TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObjec
 
 //=======================================================================
 //function : TranslateMakeMesh
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::SMESH_Mesh_ptr
@@ -3232,7 +3260,7 @@ SMESH_MeshEditor_i::TranslateMakeMesh(const SMESH::long_array& theIDsOfElements,
   }
 
   //dump "GetGroups"
-  if(!myPreviewMode && mesh_i)
+  if (!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
 
   return mesh._retn();
@@ -3240,7 +3268,7 @@ SMESH_MeshEditor_i::TranslateMakeMesh(const SMESH::long_array& theIDsOfElements,
 
 //=======================================================================
 //function : TranslateObjectMakeMesh
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::SMESH_Mesh_ptr
@@ -3274,8 +3302,8 @@ SMESH_MeshEditor_i::TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
     }
   }
 
-  //dump "GetGroups"
-  if(!myPreviewMode && mesh_i)
+  // dump "GetGroups"
+  if (!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
 
   return mesh._retn();
@@ -3283,7 +3311,7 @@ SMESH_MeshEditor_i::TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
 
 //=======================================================================
 //function : rotate
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -3306,10 +3334,13 @@ SMESH_MeshEditor_i::rotate(TIDSortedElemSet &        theElements,
   ::SMESH_MeshEditor::PGroupIDs groupIds =
       anEditor.Transform (theElements, aTrsf, theCopy, theMakeGroups, theTargetMesh);
 
-  if(theCopy) 
+  if(theCopy)
     storeResult(anEditor);
   else
-    myMesh->SetIsModified( true );
+    {
+      myMesh->GetMeshDS()->Modified();
+      myMesh->SetIsModified( true );
+    }
 
   return theMakeGroups ? getGroups(groupIds.get()) : 0;
 }
@@ -3324,14 +3355,14 @@ void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements,
                                 CORBA::Double             theAngle,
                                 CORBA::Boolean            theCopy)
 {
-  if ( !myPreviewMode ) {
+  if (!myPreviewMode) {
     TPythonDump() << this << ".Rotate( "
                   << theIDsOfElements << ", "
                   << theAxis << ", "
                   << theAngle << ", "
                   << theCopy << " )";
   }
-  if ( theIDsOfElements.length() > 0 )
+  if (theIDsOfElements.length() > 0)
   {
     TIDSortedElemSet elements;
     arrayToSet(theIDsOfElements, GetMeshDS(), elements);
@@ -3363,7 +3394,7 @@ void SMESH_MeshEditor_i::RotateObject(SMESH::SMESH_IDSource_ptr theObject,
 
 //=======================================================================
 //function : RotateMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -3371,16 +3402,17 @@ SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::long_array& theIDsOfElements,
                                      const SMESH::AxisStruct& theAxis,
                                      CORBA::Double            theAngle)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups * aGroups = 0;
-  if ( theIDsOfElements.length() > 0 )
+  if (theIDsOfElements.length() > 0)
   {
     TIDSortedElemSet elements;
     arrayToSet(theIDsOfElements, GetMeshDS(), elements);
     aGroups = rotate(elements,theAxis,theAngle,true,true);
   }
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
     aPythonDump << this << ".RotateMakeGroups( "
                 << theIDsOfElements << ", "
                 << theAxis << ", "
@@ -3391,7 +3423,7 @@ SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::long_array& theIDsOfElements,
 
 //=======================================================================
 //function : RotateObjectMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -3399,14 +3431,15 @@ SMESH_MeshEditor_i::RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
                                            const SMESH::AxisStruct&  theAxis,
                                            CORBA::Double             theAngle)
 {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
   SMESH::ListOfGroups * aGroups = 0;
   TIDSortedElemSet elements;
-  if ( idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
-    aGroups =  rotate(elements,theAxis,theAngle,true,true);
+  if (idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
+    aGroups = rotate(elements, theAxis, theAngle, true, true);
 
-  if ( !myPreviewMode ) {
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
     aPythonDump << this << ".RotateObjectMakeGroups( "
                 << theObject << ", "
                 << theAxis << ", "
@@ -3417,10 +3450,10 @@ SMESH_MeshEditor_i::RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
 
 //=======================================================================
 //function : RotateMakeMesh
-//purpose  : 
+//purpose  :
 //=======================================================================
 
-SMESH::SMESH_Mesh_ptr 
+SMESH::SMESH_Mesh_ptr
 SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::long_array& theIDsOfElements,
                                    const SMESH::AxisStruct& theAxis,
                                    CORBA::Double            theAngleInRadians,
@@ -3456,8 +3489,8 @@ SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::long_array& theIDsOfElements,
     }
   }
 
-  //dump "GetGroups"
-  if(!myPreviewMode && mesh_i && theIDsOfElements.length() > 0 )
+  // dump "GetGroups"
+  if (!myPreviewMode && mesh_i && theIDsOfElements.length() > 0 )
     mesh_i->GetGroups();
 
   return mesh._retn();
@@ -3465,7 +3498,7 @@ SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::long_array& theIDsOfElements,
 
 //=======================================================================
 //function : RotateObjectMakeMesh
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::SMESH_Mesh_ptr
@@ -3503,8 +3536,8 @@ SMESH_MeshEditor_i::RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
     }
   }
 
-  //dump "GetGroups"
-  if(!myPreviewMode && mesh_i)
+  // dump "GetGroups"
+  if (!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
 
   return mesh._retn();
@@ -3512,7 +3545,7 @@ SMESH_MeshEditor_i::RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
 
 //=======================================================================
 //function : scale
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -3550,8 +3583,10 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr  theObject,
   if(theCopy)
     storeResult(anEditor);
   else
-    myMesh->SetIsModified( true );
-
+    {
+      myMesh->GetMeshDS()->Modified();
+      myMesh->SetIsModified( true );
+    }
   return theMakeGroups ? getGroups(groupIds.get()) : 0;
 }
 
@@ -3579,7 +3614,7 @@ void SMESH_MeshEditor_i::Scale(SMESH::SMESH_IDSource_ptr  theObject,
 
 //=======================================================================
 //function : ScaleMakeGroups
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::ListOfGroups*
@@ -3587,11 +3622,11 @@ SMESH_MeshEditor_i::ScaleMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                     const SMESH::PointStruct&  thePoint,
                                     const SMESH::double_array& theScaleFact)
 {
-  SMESH::ListOfGroups * aGroups = scale(theObject, thePoint, theScaleFact, true, true);
-  if ( !myPreviewMode ) {
+  TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
 
-    TPythonDump aPythonDump;
-    DumpGroupsList(aPythonDump,aGroups);
+  SMESH::ListOfGroups * aGroups = scale(theObject, thePoint, theScaleFact, true, true);
+  if (!myPreviewMode) {
+    DumpGroupsList(aPythonDump, aGroups);
     aPythonDump << this << ".Scale("
                 << theObject << ","
                 << "SMESH.PointStruct(" <<thePoint.x << ","
@@ -3604,7 +3639,7 @@ SMESH_MeshEditor_i::ScaleMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
 
 //=======================================================================
 //function : ScaleMakeMesh
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 SMESH::SMESH_Mesh_ptr
@@ -3638,8 +3673,8 @@ SMESH_MeshEditor_i::ScaleMakeMesh(SMESH::SMESH_IDSource_ptr  theObject,
              << theMeshName << "' )";
   }
 
-  //dump "GetGroups"
-  if(!myPreviewMode && mesh_i)
+  // dump "GetGroups"
+  if (!myPreviewMode && mesh_i)
     mesh_i->GetGroups();
 
   return mesh._retn();
@@ -3796,7 +3831,7 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN
   anEditor.MergeNodes( aListOfListOfNodes );
 
   aTPythonDump <<  "])";
-
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true );
 }
 
@@ -3878,7 +3913,7 @@ void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& GroupsO
 
   ::SMESH_MeshEditor anEditor( myMesh );
   anEditor.MergeElements(aListOfListOfElementsID);
-
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true );
 
   aTPythonDump << "] )";
@@ -3926,15 +3961,15 @@ CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long   NodeID,
     TIDSortedElemSet linkedNodes;
     ::SMESH_MeshEditor::GetLinkedNodes( node, linkedNodes );
     TIDSortedElemSet::iterator nIt = linkedNodes.begin();
+    SMDS_MeshNode *nodeCpy1 = tmpMesh.Copy(node);
     for ( ; nIt != linkedNodes.end(); ++nIt )
     {
-      SMDS_MeshEdge edge( node, cast2Node( *nIt ));
-      tmpMesh.Copy( &edge );
+      SMDS_MeshNode *nodeCpy2 = tmpMesh.Copy ( cast2Node( *nIt ));
+      tmpMesh.GetMeshDS()->AddEdge(nodeCpy1, nodeCpy2);
     }
     // move copied node
-    node = tmpMesh.GetMeshDS()->FindNode( NodeID );
-    if ( node )
-      tmpMesh.GetMeshDS()->MoveNode(node, x, y, z);
+    if ( nodeCpy1 )
+      tmpMesh.GetMeshDS()->MoveNode(nodeCpy1, x, y, z);
     // fill preview data
     ::SMESH_MeshEditor anEditor( & tmpMesh );
     storeResult( anEditor );
@@ -3949,7 +3984,7 @@ CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long   NodeID,
     // Update Python script
     TPythonDump() << "isDone = " << this << ".MoveNode( "
                   << NodeID << ", " << x << ", " << y << ", " << z << " )";
-
+    myMesh->GetMeshDS()->Modified();
     myMesh->SetIsModified( true );
   }
 
@@ -4021,7 +4056,7 @@ CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x,
       TIDSortedElemSet::iterator nIt = linkedNodes.begin();
       for ( ; nIt != linkedNodes.end(); ++nIt )
       {
-        SMDS_MeshEdge edge( node, cast2Node( *nIt ));
+        SMDS_LinearEdge edge( node, cast2Node( *nIt ));
         tmpMesh.Copy( &edge );
       }
       // move copied node
@@ -4048,6 +4083,7 @@ CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x,
                   << ".MoveClosestNodeToPoint( "<< x << ", " << y << ", " << z
                   << ", " << nodeID << " )";
 
+    myMesh->GetMeshDS()->Modified();
     myMesh->SetIsModified( true );
   }
 
@@ -4193,6 +4229,7 @@ SMESH_MeshEditor_i::SewFreeBorders(CORBA::Long FirstNodeID1,
 
   storeResult(anEditor);
 
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true );
 
   return error;
@@ -4250,6 +4287,7 @@ SMESH_MeshEditor_i::SewConformFreeBorders(CORBA::Long FirstNodeID1,
 
   storeResult(anEditor);
 
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true );
 
   return error;
@@ -4312,6 +4350,7 @@ SMESH_MeshEditor_i::SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
 
   storeResult(anEditor);
 
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true );
 
   return error;
@@ -4369,6 +4408,7 @@ SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
 
   storeResult(anEditor);
 
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true );
 
   return error;
@@ -4405,8 +4445,10 @@ CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide,
   TPythonDump() << "isDone = " << this << ".ChangeElemNodes( "
                 << ide << ", " << newIDs << " )";
 
+  MESSAGE("ChangeElementNodes");
   bool res = GetMeshDS()->ChangeElementNodes( elem, & aNodes[0], nbn1+1 );
 
+  myMesh->GetMeshDS()->Modified();
   if ( res )
     myMesh->SetIsModified( true );
 
@@ -4422,7 +4464,7 @@ CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide,
 
 void SMESH_MeshEditor_i::storeResult(::SMESH_MeshEditor& anEditor)
 {
-  if ( myPreviewMode ) { // --- MeshPreviewStruct filling --- 
+  if ( myPreviewMode ) { // --- MeshPreviewStruct filling ---
 
     list<int> aNodesConnectivity;
     typedef map<int, int> TNodesMap;
@@ -4453,7 +4495,7 @@ void SMESH_MeshEditor_i::storeResult(::SMESH_MeshEditor& anEditor)
 
       SMDS_ElemIteratorPtr itElemNodes = aMeshElem->nodesIterator();
       while ( itElemNodes->more() ) {
-        const SMDS_MeshNode* aMeshNode = 
+        const SMDS_MeshNode* aMeshNode =
           static_cast<const SMDS_MeshNode*>( itElemNodes->next() );
         int aNodeID = aMeshNode->GetID();
         TNodesMap::iterator anIter = nodesMap.find(aNodeID);
@@ -4558,12 +4600,13 @@ void SMESH_MeshEditor_i::ConvertToQuadratic(CORBA::Boolean theForce3d)
   ::SMESH_MeshEditor anEditor( myMesh );
   anEditor.ConvertToQuadratic(theForce3d);
   TPythonDump() << this << ".ConvertToQuadratic( " << theForce3d << " )";
+  myMesh->GetMeshDS()->Modified();
   myMesh->SetIsModified( true );
 }
 
 //=======================================================================
 //function : ConvertFromQuadratic
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 CORBA::Boolean SMESH_MeshEditor_i::ConvertFromQuadratic()
@@ -4571,6 +4614,7 @@ CORBA::Boolean SMESH_MeshEditor_i::ConvertFromQuadratic()
   ::SMESH_MeshEditor anEditor( myMesh );
   CORBA::Boolean isDone = anEditor.ConvertFromQuadratic();
   TPythonDump() << this << ".ConvertFromQuadratic()";
+  myMesh->GetMeshDS()->Modified();
   if ( isDone )
     myMesh->SetIsModified( true );
   return isDone;
@@ -4578,7 +4622,7 @@ CORBA::Boolean SMESH_MeshEditor_i::ConvertFromQuadratic()
 
 //=======================================================================
 //function : makeMesh
-//purpose  : create a named imported mesh 
+//purpose  : create a named imported mesh
 //=======================================================================
 
 SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::makeMesh(const char* theMeshName)
@@ -4597,7 +4641,7 @@ SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::makeMesh(const char* theMeshName)
 //function : DumpGroupsList
 //purpose  :
 //=======================================================================
-void SMESH_MeshEditor_i::DumpGroupsList(TPythonDump &               theDumpPython, 
+void SMESH_MeshEditor_i::DumpGroupsList(TPythonDump &               theDumpPython,
                                         const SMESH::ListOfGroups * theGroupList)
 {
   bool isDumpGroupList = theGroupList && theGroupList->length() > 0;
@@ -4617,7 +4661,7 @@ string SMESH_MeshEditor_i::generateGroupName(const string& thePrefix)
 {
   SMESH::ListOfGroups_var groups = myMesh_i->GetGroups();
   set<string> groupNames;
-  
+
   // Get existing group names
   for (int i = 0, nbGroups = groups->length(); i < nbGroups; i++ ) {
     SMESH::SMESH_GroupBase_var aGroup = groups[i];
@@ -4642,7 +4686,7 @@ string SMESH_MeshEditor_i::generateGroupName(const string& thePrefix)
     }
     ++index;
   }
-  
+
   return name;
 }
 
@@ -4650,15 +4694,15 @@ string SMESH_MeshEditor_i::generateGroupName(const string& thePrefix)
 /*!
   \brief Creates a hole in a mesh by doubling the nodes of some particular elements
   \param theNodes - identifiers of nodes to be doubled
-  \param theModifiedElems - identifiers of elements to be updated by the new (doubled) 
-         nodes. If list of element identifiers is empty then nodes are doubled but 
+  \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
+         nodes. If list of element identifiers is empty then nodes are doubled but
          they not assigned to elements
   \return TRUE if operation has been completed successfully, FALSE otherwise
   \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
 */
 //================================================================================
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNodes, 
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNodes,
                                                 const SMESH::long_array& theModifiedElems )
 {
   initData();
@@ -4675,6 +4719,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNode
 
   bool aResult = aMeshEditor.DoubleNodes( aListOfNodes, aListOfElems );
 
+  myMesh->GetMeshDS()->Modified();
   storeResult( aMeshEditor) ;
   if ( aResult )
     myMesh->SetIsModified( true );
@@ -4696,7 +4741,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNode
 */
 //================================================================================
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( CORBA::Long              theNodeId, 
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( CORBA::Long              theNodeId,
                                                const SMESH::long_array& theModifiedElems )
 {
   SMESH::long_array_var aNodes = new SMESH::long_array;
@@ -4733,7 +4778,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroup(SMESH::SMESH_GroupBase_ptr th
   SMESH::long_array_var aModifiedElems;
   if ( !CORBA::is_nil( theModifiedElems ) )
     aModifiedElems = theModifiedElems->GetListOfID();
-  else 
+  else
   {
     aModifiedElems = new SMESH::long_array;
     aModifiedElems->length( 0 );
@@ -4761,7 +4806,7 @@ SMESH::SMESH_Group_ptr SMESH_MeshEditor_i::DoubleNodeGroupNew( SMESH::SMESH_Grou
 {
   if ( CORBA::is_nil( theNodes ) && theNodes->GetType() != SMESH::NODE )
     return false;
-  
+
   SMESH::SMESH_Group_var aNewGroup;
 
   // Duplicate nodes
@@ -4773,7 +4818,7 @@ SMESH::SMESH_Group_ptr SMESH_MeshEditor_i::DoubleNodeGroupNew( SMESH::SMESH_Grou
     aModifiedElems = new SMESH::long_array;
     aModifiedElems->length( 0 );
   }
-  
+
   TPythonDump pyDump; // suppress dump by the next line
 
   bool aResult = DoubleNodes( aNodes, aModifiedElems );
@@ -4789,7 +4834,7 @@ SMESH::SMESH_Group_ptr SMESH_MeshEditor_i::DoubleNodeGroupNew( SMESH::SMESH_Grou
       aNewGroup->Add(anIds);
     }
   }
-  
+
   pyDump << "createdNodes = " << this << ".DoubleNodeGroupNew( " << theNodes << ", "
     << theModifiedElems << " )";
 
@@ -4843,6 +4888,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroups(const SMESH::ListOfGroups& t
 
   storeResult( aMeshEditor) ;
 
+  myMesh->GetMeshDS()->Modified();
   if ( aResult )
     myMesh->SetIsModified( true );
 
@@ -4858,14 +4904,14 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroups(const SMESH::ListOfGroups& t
   \param theElems - the list of elements (edges or faces) to be replicated
   The nodes for duplication could be found from these elements
   \param theNodesNot - list of nodes to NOT replicate
-  \param theAffectedElems - the list of elements (cells and edges) to which the 
+  \param theAffectedElems - the list of elements (cells and edges) to which the
   replicated nodes should be associated to.
   \return TRUE if operation has been completed successfully, FALSE otherwise
   \sa DoubleNodeGroup(), DoubleNodeGroups()
 */
 //================================================================================
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theElems, 
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theElems,
                                                    const SMESH::long_array& theNodesNot,
                                                    const SMESH::long_array& theAffectedElems )
 
@@ -4884,6 +4930,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theE
 
   storeResult( aMeshEditor) ;
 
+  myMesh->GetMeshDS()->Modified();
   if ( aResult )
     myMesh->SetIsModified( true );
 
@@ -4907,7 +4954,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theE
 */
 //================================================================================
 
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::long_array& theElems, 
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::long_array& theElems,
                                                             const SMESH::long_array& theNodesNot,
                                                             GEOM::GEOM_Object_ptr    theShape )
 
@@ -4926,6 +4973,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::long_ar
 
   storeResult( aMeshEditor) ;
 
+  myMesh->GetMeshDS()->Modified();
   if ( aResult )
     myMesh->SetIsModified( true );
 
@@ -4960,14 +5008,15 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroup(SMESH::SMESH_GroupBase_pt
 
   SMESHDS_Mesh* aMeshDS = GetMeshDS();
   TIDSortedElemSet anElems, aNodes, anAffected;
-  idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All ); 
-  idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node ); 
+  idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All );
+  idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node );
   idSourceToSet( theAffectedElems, aMeshDS, anAffected, SMDSAbs_All );
 
   bool aResult = aMeshEditor.DoubleNodes( anElems, aNodes, anAffected );
 
   storeResult( aMeshEditor) ;
 
+  myMesh->GetMeshDS()->Modified();
   if ( aResult )
     myMesh->SetIsModified( true );
 
@@ -5002,13 +5051,13 @@ SMESH::SMESH_Group_ptr SMESH_MeshEditor_i::DoubleNodeElemGroupNew(SMESH::SMESH_G
 
   SMESHDS_Mesh* aMeshDS = GetMeshDS();
   TIDSortedElemSet anElems, aNodes, anAffected;
-  idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All ); 
-  idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node ); 
+  idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All );
+  idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node );
   idSourceToSet( theAffectedElems, aMeshDS, anAffected, SMDSAbs_All );
 
-  
+
   bool aResult = aMeshEditor.DoubleNodes( anElems, aNodes, anAffected );
-  
+
   storeResult( aMeshEditor) ;
 
   if ( aResult ) {
@@ -5058,14 +5107,15 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroupInRegion(SMESH::SMESH_Grou
 
   SMESHDS_Mesh* aMeshDS = GetMeshDS();
   TIDSortedElemSet anElems, aNodes, anAffected;
-  idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All ); 
-  idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node ); 
+  idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All );
+  idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node );
 
   TopoDS_Shape aShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theShape );
   bool aResult = aMeshEditor.DoubleNodesInRegion( anElems, aNodes, aShape );
 
   storeResult( aMeshEditor) ;
 
+  myMesh->GetMeshDS()->Modified();
   if ( aResult )
     myMesh->SetIsModified( true );
 
@@ -5084,7 +5134,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroupInRegion(SMESH::SMESH_Grou
   \param theAffectedElems - group of elements to which the replicated nodes
   should be associated to.
   \return TRUE if operation has been completed successfully, FALSE otherwise
-  \sa DoubleNodeGroup(), DoubleNodes()
+  \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
 */
 //================================================================================
 
@@ -5096,7 +5146,7 @@ static void listOfGroupToSet(const SMESH::ListOfGroups& theGrpList,
   for ( int i = 0, n = theGrpList.length(); i < n; i++ )
   {
     SMESH::SMESH_GroupBase_var aGrp = theGrpList[ i ];
-    if ( !CORBA::is_nil( aGrp ) && (theIsNodeGrp ? aGrp->GetType() == SMESH::NODE 
+    if ( !CORBA::is_nil( aGrp ) && (theIsNodeGrp ? aGrp->GetType() == SMESH::NODE
                                     : aGrp->GetType() != SMESH::NODE ) )
     {
       SMESH::long_array_var anIDs = aGrp->GetIDs();
@@ -5123,6 +5173,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroups(const SMESH::ListOfGroup
 
   storeResult( aMeshEditor) ;
 
+  myMesh->GetMeshDS()->Modified();
   if ( aResult )
     myMesh->SetIsModified( true );
 
@@ -5132,6 +5183,60 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroups(const SMESH::ListOfGroup
   return aResult;
 }
 
+//================================================================================
+/*!
+ * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+ * Works as DoubleNodeElemGroups(), but returns a new group with newly created elements.
+  \param theElems - list of groups of elements (edges or faces) to be replicated
+  \param theNodesNot - list of groups of nodes not to replicated
+  \param theAffectedElems - group of elements to which the replicated nodes
+  should be associated to.
+ * \return a new group with newly created elements
+ * \sa DoubleNodeElemGroups()
+ */
+//================================================================================
+
+SMESH::SMESH_Group_ptr SMESH_MeshEditor_i::DoubleNodeElemGroupsNew(const SMESH::ListOfGroups& theElems,
+                                                                   const SMESH::ListOfGroups& theNodesNot,
+                                                                   const SMESH::ListOfGroups& theAffectedElems)
+{
+  SMESH::SMESH_Group_var aNewGroup;
+  
+  initData();
+
+  ::SMESH_MeshEditor aMeshEditor( myMesh );
+
+  SMESHDS_Mesh* aMeshDS = GetMeshDS();
+  TIDSortedElemSet anElems, aNodes, anAffected;
+  listOfGroupToSet(theElems, aMeshDS, anElems, false );
+  listOfGroupToSet(theNodesNot, aMeshDS, aNodes, true );
+  listOfGroupToSet(theAffectedElems, aMeshDS, anAffected, false );
+
+  bool aResult = aMeshEditor.DoubleNodes( anElems, aNodes, anAffected );
+
+  storeResult( aMeshEditor) ;
+
+  myMesh->GetMeshDS()->Modified();
+  if ( aResult ) {
+    myMesh->SetIsModified( true );
+
+    // Create group with newly created elements
+    SMESH::long_array_var anIds = GetLastCreatedElems();
+    if (anIds->length() > 0) {
+      SMESH::ElementType aGroupType = myMesh_i->GetElementType(anIds[0], true);
+      string anUnindexedName (theElems[0]->GetName());
+      string aNewName = generateGroupName(anUnindexedName + "_double");
+      aNewGroup = myMesh_i->CreateGroup(aGroupType, aNewName.c_str());
+      aNewGroup->Add(anIds);
+    }
+  }
+
+  // Update Python script
+  TPythonDump() << "createdElems = " << this << ".DoubleNodeElemGroupsNew( " << &theElems << ", "
+                << &theNodesNot << ", " << &theAffectedElems << " )";
+  return aNewGroup._retn();
+}
+
 //================================================================================
 /*!
   \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -5165,6 +5270,7 @@ SMESH_MeshEditor_i::DoubleNodeElemGroupsInRegion(const SMESH::ListOfGroups& theE
 
   storeResult( aMeshEditor) ;
 
+  myMesh->GetMeshDS()->Modified();
   if ( aResult )
     myMesh->SetIsModified( true );
 
@@ -5189,11 +5295,60 @@ CORBA::Boolean SMESH_MeshEditor_i::Make2DMeshFrom3D()
   ::SMESH_MeshEditor aMeshEditor( myMesh );
   bool aResult = aMeshEditor.Make2DMeshFrom3D();
   storeResult( aMeshEditor) ;
-
+  myMesh->GetMeshDS()->Modified();
   TPythonDump() << "isDone = " << this << ".Make2DMeshFrom3D()";
   return aResult;
 }
 
+//================================================================================
+/*!
+ * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
+ * The list of groups must describe a partition of the mesh volumes.
+ * The nodes of the internal faces at the boundaries of the groups are doubled.
+ * In option, the internal faces are replaced by flat elements.
+ * Triangles are transformed in prisms, and quadrangles in hexahedrons.
+ * @param theDomains - list of groups of volumes
+ * @param createJointElems - if TRUE, create the elements
+ * @return TRUE if operation has been completed successfully, FALSE otherwise
+ */
+//================================================================================
+
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
+                                                                 CORBA::Boolean createJointElems )
+{
+  initData();
+
+  ::SMESH_MeshEditor aMeshEditor( myMesh );
+
+  SMESHDS_Mesh* aMeshDS = GetMeshDS();
+
+  vector<TIDSortedElemSet> domains;
+  domains.clear();
+
+  for ( int i = 0, n = theDomains.length(); i < n; i++ )
+  {
+    SMESH::SMESH_GroupBase_var aGrp = theDomains[ i ];
+    if ( !CORBA::is_nil( aGrp ) && ( aGrp->GetType() != SMESH::NODE ) )
+    {
+      TIDSortedElemSet domain;
+      domain.clear();
+      domains.push_back(domain);
+      SMESH::long_array_var anIDs = aGrp->GetIDs();
+      arrayToSet( anIDs, aMeshDS, domains[ i ], SMDSAbs_All );
+    }
+  }
+
+  bool aResult = aMeshEditor.DoubleNodesOnGroupBoundaries( domains, createJointElems );
+
+  storeResult( aMeshEditor) ;
+  myMesh->GetMeshDS()->Modified();
+
+  // Update Python script
+  TPythonDump() << "isDone = " << this << ".DoubleNodesOnGroupBoundaries( " << &theDomains
+      << ", " << createJointElems << " )";
+  return aResult;
+}
+
 // issue 20749 ===================================================================
 /*!
  * \brief Creates missing boundary elements
@@ -5204,7 +5359,7 @@ CORBA::Boolean SMESH_MeshEditor_i::Make2DMeshFrom3D()
  *  \param meshName - a name of new mesh to store created boundary elements in,
  *                     "" means not to create the new mesh
  *  \param toCopyElements - if true, the checked elements will be copied into the new mesh
- *  \param toCopyExistingBondary - if true, not only new but also pre-existing 
+ *  \param toCopyExistingBondary - if true, not only new but also pre-existing
  *                                boundary elements will be copied into the new mesh
  *  \param group - returns the create group, if any
  *  \retval SMESH::SMESH_Mesh - the mesh where elements were added to
@@ -5225,7 +5380,7 @@ SMESH_MeshEditor_i::MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr idSource,
   if ( dim > SMESH::BND_1DFROM2D )
     THROW_SALOME_CORBA_EXCEPTION("Invalid boundary dimension", SALOME::BAD_PARAM);
 
-  
+
   SMESHDS_Mesh* aMeshDS = GetMeshDS();
 
   SMESH::SMESH_Mesh_var mesh_var;
@@ -5248,7 +5403,7 @@ SMESH_MeshEditor_i::MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr idSource,
     SMESH_Group* smesh_group = 0;
     if ( strlen(groupName) )
     {
-      group_var = mesh_i->CreateGroup( SMESH::ElementType(elemType),groupName);
+      group_var = mesh_i->CreateGroup( SMESH::ElementType(int(elemType)-1),groupName);
       if ( SMESH_GroupBase_i* group_i = SMESH::DownCast<SMESH_GroupBase_i*>( group_var ))
         smesh_group = group_i->GetSmeshGroup();
     }
@@ -5264,6 +5419,8 @@ SMESH_MeshEditor_i::MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr idSource,
     storeResult( aMeshEditor );
   }
 
+  const char* dimName[] = { "BND_2DFROM3D", "BND_1DFROM3D", "BND_1DFROM2D" };
+
   // result of MakeBoundaryMesh() is a tuple (mesh, group)
   if ( mesh_var->_is_nil() )
     pyDump << myMesh_i->_this() << ", ";
@@ -5275,9 +5432,9 @@ SMESH_MeshEditor_i::MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr idSource,
     pyDump << group_var << " = ";
   pyDump << this << ".MakeBoundaryMesh( "
          << idSource << ", "
-         << dim << ", "
-         << groupName << ", "
-         << meshName<< ", "
+         << "SMESH." << dimName[int(dim)] << ", "
+         << "'" << groupName << "', "
+         << "'" << meshName<< "', "
          << toCopyElements << ", "
          << toCopyExistingBondary << ")";