Skip to content

Commit

Permalink
PartDesign: [skip ci] make base object visible again if initial addit…
Browse files Browse the repository at this point in the history
…ive helix fails to recompute
  • Loading branch information
wwmayer committed Feb 17, 2021
1 parent 8e16225 commit 2661e0e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Mod/PartDesign/Gui/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
};

Expand Down

0 comments on commit 2661e0e

Please sign in to comment.