From b01c503c2cb37b2ed4fb848b0f495f599a7b179f Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 9 Nov 2017 23:21:06 +0100 Subject: [PATCH] fixes #0003159: ShapeBinder is part of solid --- src/Mod/PartDesign/App/Feature.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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");