add 2d features to body for drag and drop

This commit is contained in:
wmayer
2017-11-05 12:37:46 +01:00
parent d5d3513a56
commit 71fbfa952f
2 changed files with 8 additions and 2 deletions

View File

@@ -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<App::DocumentObject*> planes;

View File

@@ -454,7 +454,13 @@ bool ViewProviderBody::canDropObject(App::DocumentObject* obj) const
void ViewProviderBody::dropObject(App::DocumentObject* obj)
{
PartDesign::Body* body = static_cast<PartDesign::Body*>(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();