From a6c8f38cf08c4dd8605496d27fbc5c3e02a19bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Thu, 14 Jan 2016 21:44:43 +0100 Subject: [PATCH] no body allowed as body base feature --- src/Mod/PartDesign/Gui/CommandBody.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/Gui/CommandBody.cpp b/src/Mod/PartDesign/Gui/CommandBody.cpp index 666b686a4..ba891eaac 100644 --- a/src/Mod/PartDesign/Gui/CommandBody.cpp +++ b/src/Mod/PartDesign/Gui/CommandBody.cpp @@ -142,10 +142,18 @@ void CmdPartDesignBody::activated(int iMsg) baseFeature = features[0]; if ( baseFeature->isDerivedFrom ( PartDesign::Feature::getClassTypeId() ) && PartDesign::Body::findBodyOf ( baseFeature ) ) { - // Prevent creatung bodies based on features already belonging to other bodies + // Prevent creating bodies based on features already belonging to other bodies QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Bad base feature"), QObject::tr("Body can't be based on a PartDesign feature.")); - return; + baseFeature = nullptr; + + } + + if ( baseFeature->isDerivedFrom ( Part::BodyBase::getClassTypeId() ) ) { + // Prevent creating bodies based on bodies + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Bad base feature"), + QObject::tr("Body can't be based on annother body.")); + baseFeature = nullptr; }