diff --git a/src/Mod/PartDesign/App/Feature.cpp b/src/Mod/PartDesign/App/Feature.cpp index bcee81ff59..7f19a9516d 100644 --- a/src/Mod/PartDesign/App/Feature.cpp +++ b/src/Mod/PartDesign/App/Feature.cpp @@ -39,6 +39,7 @@ #include #include "App/OriginFeature.h" #include "Body.h" +#include "ShapeBinder.h" #include "Feature.h" #include "FeaturePy.h" #include "Mod/Part/App/DatumFeature.h" @@ -120,6 +121,10 @@ Part::Feature* Feature::getBaseObject(bool silent) const { const TopoDS_Shape& Feature::getBaseShape() const { const Part::Feature* BaseObject = getBaseObject(); + if (BaseObject->isDerivedFrom(PartDesign::ShapeBinder::getClassTypeId())) { + throw Base::ValueError("Base shape of shape binder cannot be used"); + } + const TopoDS_Shape& result = BaseObject->Shape.getValue(); if (result.IsNull()) throw Base::Exception("Base feature's shape is invalid"); @@ -133,6 +138,10 @@ const TopoDS_Shape& Feature::getBaseShape() const { const Part::TopoShape Feature::getBaseTopoShape() const { const Part::Feature* BaseObject = getBaseObject(); + if (BaseObject->isDerivedFrom(PartDesign::ShapeBinder::getClassTypeId())) { + throw Base::ValueError("Base shape of shape binder cannot be used"); + } + const Part::TopoShape& result = BaseObject->Shape.getShape(); if (result.getShape().IsNull()) throw Base::Exception("Base feature's TopoShape is invalid");