allow the user to proceed if default settings for revolution/groove raises an exception

This commit is contained in:
wmayer
2017-10-18 12:52:04 +02:00
parent 6e898575c2
commit 7c4dc0d669

View File

@@ -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<PartDesign::Groove*>(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<PartDesign::Groove*>(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();