From 7c4dc0d6699f2842c6c5d2c97d0eee121f0e9092 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 18 Oct 2017 12:52:04 +0200 Subject: [PATCH] allow the user to proceed if default settings for revolution/groove raises an exception --- src/Mod/PartDesign/Gui/Command.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 1b03e8d75a..c110329d32 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -1209,9 +1209,17 @@ void CmdPartDesignGroove::activated(int iMsg) } Gui::Command::doCommand(Doc,"App.activeDocument().%s.Angle = 360.0",FeatName.c_str()); - PartDesign::Groove* pcGroove = static_cast(cmd->getDocument()->getObject(FeatName.c_str())); - if (pcGroove && pcGroove->suggestReversed()) - Gui::Command::doCommand(Doc,"App.activeDocument().%s.Reversed = 1",FeatName.c_str()); + + try { + // This raises as exception if line is perpendicular to sketch/support face. + // Here we should continue to give the user a chance to change the default values. + PartDesign::Groove* pcGroove = static_cast(cmd->getDocument()->getObject(FeatName.c_str())); + if (pcGroove && pcGroove->suggestReversed()) + Gui::Command::doCommand(Doc,"App.activeDocument().%s.Reversed = 1",FeatName.c_str()); + } + catch (const Base::Exception& e) { + e.ReportException(); + } finishProfileBased(cmd, sketch, FeatName); cmd->adjustCameraPosition();