diff --git a/src/Mod/Part/App/PartFeatures.cpp b/src/Mod/Part/App/PartFeatures.cpp index 68c969c5f18a..86ec1f1cc7b6 100644 --- a/src/Mod/Part/App/PartFeatures.cpp +++ b/src/Mod/Part/App/PartFeatures.cpp @@ -84,20 +84,20 @@ App::DocumentObjectExecReturn* RuledSurface::getShape(const App::PropertyLinkSub TopoDS_Shape& shape) const { App::DocumentObject* obj = link.getValue(); - if(!obj) + if (!(obj && obj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))) return new App::DocumentObjectExecReturn("No shape linked."); // if no explicit sub-shape is selected use the whole part const std::vector& element = link.getSubValues(); if (element.empty()) { - shape = Feature::getShape(obj); + shape = static_cast(obj)->Shape.getValue(); return nullptr; } else if (element.size() != 1) { return new App::DocumentObjectExecReturn("Not exactly one sub-shape linked."); } - const Part::TopoShape& part = Feature::getTopoShape(obj); + const Part::TopoShape& part = static_cast(obj)->Shape.getValue(); if (!part.getShape().IsNull()) { if (!element[0].empty()) { shape = part.getSubShape(element[0].c_str());