From: mpv Date: Mon, 15 May 2017 10:41:21 +0000 (+0300) Subject: Fix for the issue #2156: Impossible to valid the sketch after macro-feature is executed. X-Git-Tag: V_2.7.1~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0c85f3df28d53c21a3e7cc98ce3925196ebeecf6;p=modules%2Fshaper.git Fix for the issue #2156: Impossible to valid the sketch after macro-feature is executed. --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index ee2e42be8..dde55788f 100755 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -314,9 +314,22 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag // processed features must be only on finish, so clear anyway (to avoid reimport on load) myProcessOnFinish.clear(); + // #2156: current must be sketch, left after the macro execution + DocumentPtr anActiveDoc = ModelAPI_Session::get()->activeDocument(); + FeaturePtr aCurrent; + if (anActiveDoc.get()) + aCurrent = anActiveDoc->currentFeature(false); + if (!(theMessage->eventID() == kOpStartEvent)) { processFeatures(false); } + + if (anActiveDoc.get() && aCurrent.get() && aCurrent->data()->isValid()) { + if (anActiveDoc->currentFeature(false) != aCurrent) + anActiveDoc->setCurrentFeature(aCurrent, false); // #2156 make the current feature back + } + + // remove all macros before clearing all created std::set::iterator anUpdatedIter = myWaitForFinish.begin(); while(anUpdatedIter != myWaitForFinish.end()) {