From 8a041ffc8ea0d44f8ffc3a463909ee3fff4ec54b Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Sun, 25 Aug 2013 17:31:02 +0200 Subject: [PATCH] Fix bug that didn't allow to select base plane to create a sketch on it --- src/Mod/PartDesign/Gui/Command.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index c25290ed5..9b6e6d634 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -808,9 +808,18 @@ void CmdPartDesignNewSketch::activated(int iMsg) } if (!pcActiveBody->hasFeature(feat)) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection from other body"), - QObject::tr("You have to select a face or plane from the active body!")); - return; + bool isBasePlane = false; + for (unsigned i = 0; i < 3; i++) { + if (strcmp(PartDesignGui::BaseplaneNames[i], feat->getNameInDocument()) == 0) { + isBasePlane = true; + break; + } + } + if (!isBasePlane) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection from other body"), + QObject::tr("You have to select a face or plane from the active body!")); + return; + } } else if (pcActiveBody->isAfterTip(feat)) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection from inactive feature"), QObject::tr("You have to select a face or plane before the current insert point, or move the insert point"));