From 2661e0ea4769fd669c3b9c6510bb1efe76bdff70 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 17 Feb 2021 13:33:02 +0100 Subject: [PATCH] PartDesign: [skip ci] make base object visible again if initial additive helix fails to recompute --- src/Mod/PartDesign/Gui/Command.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index f732f2fc0254..5784f1166ff2 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -67,6 +67,7 @@ #include "ReferenceSelection.h" #include "Utils.h" #include "WorkflowManager.h" +#include "ViewProvider.h" #include "ViewProviderBody.h" // TODO Remove this header after fixing code so it won;t be needed here (2015-10-20, Fat-Zer) @@ -1723,6 +1724,19 @@ void CmdPartDesignAdditiveHelix::activated(int iMsg) } finishProfileBased(cmd, sketch, Feat); + + // If the initial helix creation fails then it leaves the base object invisible which makes things + // more difficult for the user. + // To avoid this the base obejct will be made tmp. visible again. + if (Feat->isError()) { + App::DocumentObject* base = static_cast(Feat)->BaseFeature.getValue(); + if (base) { + PartDesignGui::ViewProvider* view = dynamic_cast(Gui::Application::Instance->getViewProvider(base)); + if (view) + view->makeTemporaryVisible(true); + } + } + cmd->adjustCameraPosition(); };