From 0c85f3df28d53c21a3e7cc98ce3925196ebeecf6 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 15 May 2017 13:41:21 +0300 Subject: [PATCH] Fix for the issue #2156: Impossible to valid the sketch after macro-feature is executed. --- src/Model/Model_Update.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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()) { -- 2.39.2