From f7874306b99cac64feb030b2e656bf0184991a0e Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Sat, 31 Aug 2013 17:00:44 +0200 Subject: [PATCH] Allow Pyton features inside bodies --- src/Mod/PartDesign/App/Body.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Mod/PartDesign/App/Body.cpp b/src/Mod/PartDesign/App/Body.cpp index 42dda0394..c89584354 100644 --- a/src/Mod/PartDesign/App/Body.cpp +++ b/src/Mod/PartDesign/App/Body.cpp @@ -218,20 +218,15 @@ const bool Body::isAllowed(const App::DocumentObject* f) if (f == NULL) return false; + // TODO: Should we introduce a PartDesign::FeaturePython class? This should then also return true for isSolidFeature() return (f->getTypeId().isDerivedFrom(PartDesign::Feature::getClassTypeId()) || f->getTypeId().isDerivedFrom(Part::Datum::getClassTypeId()) || - f->getTypeId().isDerivedFrom(Part::Part2DObject::getClassTypeId())); + f->getTypeId().isDerivedFrom(Part::Part2DObject::getClassTypeId()) || + f->getTypeId().isDerivedFrom(Part::FeaturePython::getClassTypeId())); } void Body::addFeature(App::DocumentObject *feature) { - /* - // Remove this test if Workbench::slotNewObject() has been tested sufficiently in respect to Undo() and - // the addFeature() calls have been removed in Command.cpp - if (hasFeature(feature)) - return; - */ - // Set the BaseFeature property if (feature->getTypeId().isDerivedFrom(PartDesign::Feature::getClassTypeId())) { App::DocumentObject* prevSolidFeature = getPrevSolidFeature(NULL, true);