From 71fbfa952f152990767b47d81f5a66d6028f3475 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 5 Nov 2017 12:37:46 +0100 Subject: [PATCH] add 2d features to body for drag and drop --- src/Mod/PartDesign/Gui/CommandBody.cpp | 2 +- src/Mod/PartDesign/Gui/ViewProviderBody.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/Gui/CommandBody.cpp b/src/Mod/PartDesign/Gui/CommandBody.cpp index 04faaf92a5..a99eb837fb 100644 --- a/src/Mod/PartDesign/Gui/CommandBody.cpp +++ b/src/Mod/PartDesign/Gui/CommandBody.cpp @@ -242,7 +242,7 @@ void CmdPartDesignBody::activated(int iMsg) } } - // for sketches open the feature dialog to rebase it to a new pane + // for sketches open the feature dialog to rebase it to a new plane // as requested in issue #0002862 if (addtogroup) { std::vector planes; diff --git a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp index cd18a0639a..03a3db6acd 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp @@ -454,7 +454,13 @@ bool ViewProviderBody::canDropObject(App::DocumentObject* obj) const void ViewProviderBody::dropObject(App::DocumentObject* obj) { PartDesign::Body* body = static_cast(getObject()); - body->BaseFeature.setValue(obj); + if (obj->getTypeId().isDerivedFrom(Part::Part2DObject::getClassTypeId())) { + body->addObject(obj); + } + else { + body->BaseFeature.setValue(obj); + } + App::Document* doc = body->getDocument(); doc->recompute();