diff --git a/src/Mod/PartDesign/App/Body.cpp b/src/Mod/PartDesign/App/Body.cpp index 953752d656..6b5c98802c 100644 --- a/src/Mod/PartDesign/App/Body.cpp +++ b/src/Mod/PartDesign/App/Body.cpp @@ -430,33 +430,35 @@ void Body::onSettingDocument() { } void Body::onChanged (const App::Property* prop) { - if ( prop == &BaseFeature ) { - FeatureBase* bf = nullptr; - auto first = Group.getValues().empty() ? nullptr : Group.getValues().front(); - - if(BaseFeature.getValue()) { - - //setup the FeatureBase if needed - if(!first || !first->isDerivedFrom(FeatureBase::getClassTypeId())) { - bf = static_cast(getDocument()->addObject("PartDesign::FeatureBase", "BaseFeature")); - insertObject(bf, first, false); - if(!Tip.getValue()) - Tip.setValue(bf); + if (!this->getDocument()->isPerformingTransaction()) { + if ( prop == &BaseFeature ) { + FeatureBase* bf = nullptr; + auto first = Group.getValues().empty() ? nullptr : Group.getValues().front(); + + if(BaseFeature.getValue()) { + + //setup the FeatureBase if needed + if(!first || !first->isDerivedFrom(FeatureBase::getClassTypeId())) { + bf = static_cast(getDocument()->addObject("PartDesign::FeatureBase", "BaseFeature")); + insertObject(bf, first, false); + if(!Tip.getValue()) + Tip.setValue(bf); + } + else + bf = static_cast(first); } - else - bf = static_cast(first); + + if(bf && (bf->BaseFeature.getValue() != BaseFeature.getValue())) + bf->BaseFeature.setValue(BaseFeature.getValue()); } - - if(bf && (bf->BaseFeature.getValue() != BaseFeature.getValue())) - bf->BaseFeature.setValue(BaseFeature.getValue()); - } - else if( prop == &Group ) { - - //if the FeatureBase was deleted we set the BaseFeature link to nullptr - if(BaseFeature.getValue() && - (Group.getValues().empty() || !Group.getValues().front()->isDerivedFrom(FeatureBase::getClassTypeId()))) { - - BaseFeature.setValue(nullptr); + else if( prop == &Group ) { + + //if the FeatureBase was deleted we set the BaseFeature link to nullptr + if(BaseFeature.getValue() && + (Group.getValues().empty() || !Group.getValues().front()->isDerivedFrom(FeatureBase::getClassTypeId()))) { + + BaseFeature.setValue(nullptr); + } } }