PartDesign: [skip ci] make base object visible again if initial additive helix fails to recompute

This commit is contained in:
wmayer
2021-02-17 13:33:02 +01:00
parent 8e16225b03
commit 2661e0ea47

View File

@@ -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<PartDesign::Feature*>(Feat)->BaseFeature.getValue();
if (base) {
PartDesignGui::ViewProvider* view = dynamic_cast<PartDesignGui::ViewProvider*>(Gui::Application::Instance->getViewProvider(base));
if (view)
view->makeTemporaryVisible(true);
}
}
cmd->adjustCameraPosition();
};