]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_WidgetSketchCreator.cpp
Salome HOME
Add tools
[modules/shaper.git] / src / PartSet / PartSet_WidgetSketchCreator.cpp
index 34762063035f07a42ddf357d035d7845ab6a4564..4a90a591f741882a50a1d665fff13eb7d5dc299f 100644 (file)
@@ -127,8 +127,17 @@ void PartSet_WidgetSketchCreator::onStarted()
     // Launch Sketch operation
     CompositeFeaturePtr aCompFeature = 
       std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
+
+    /// add sketch feature without current feature change.
+    /// it is important to do not change the current feature in order to
+    /// after sketch edition, the extrusion cut feature becomes current
+    SessionPtr aMgr = ModelAPI_Session::get();
+    DocumentPtr aDoc = aMgr->activeDocument();
+    FeaturePtr aPreviousCurrentFeature = aDoc->currentFeature(false);
     FeaturePtr aSketch = aCompFeature->addFeature("Sketch");
+    aDoc->setCurrentFeature(aPreviousCurrentFeature, false);
 
+    // start edit operation for the sketch
     ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
                                                              (myModule->createOperation("Sketch"));
     if (aFOperation)