From 70a9cce767bec34443ef178432b14b39a82b1fe3 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Wed, 31 May 2017 00:15:39 +0200 Subject: [PATCH] Notification to the user that a body is not active when inserting a datum entity - fixes #2511 --- src/Mod/PartDesign/Gui/Command.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index dba0159846..f3e496ae3d 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -133,6 +133,8 @@ void UnifiedDatumCommand(Gui::Command &cmd, Base::Type type, std::string name) } cmd.doCommand(Gui::Command::Doc,"App.activeDocument().recompute()"); // recompute the feature based on its references cmd.doCommand(Gui::Command::Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str()); + } else { + QMessageBox::warning(Gui::getMainWindow(),QObject::tr("Error"), QObject::tr("There is no active body. Please make a body active before inserting a datum entity.")); } } catch (Base::Exception &e) { QMessageBox::warning(Gui::getMainWindow(),QObject::tr("Error"),QString::fromLatin1(e.what()));