From 0a913f43ce9d67a7f88869e3d6502a09f0e16111 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 17 Sep 2015 13:00:59 +0300 Subject: [PATCH] Extrusion Cut: the current extrusion cut feature should be restored after sketch is finished. --- src/PartSet/PartSet_WidgetSketchCreator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index 347620630..4a90a591f 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -127,8 +127,17 @@ void PartSet_WidgetSketchCreator::onStarted() // Launch Sketch operation CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast(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 (myModule->createOperation("Sketch")); if (aFOperation) -- 2.39.2