diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp index 266fd2c536..353c3b7987 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp @@ -198,12 +198,13 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo dimension = -1; // unknown dimension of mesh } if (pcMesh != NULL) { - if (pcMesh->getPropertyByName("Part")) { // PropertyLink - App::PropertyLink* pcLink= static_cast(pcMesh->getPropertyByName("Part")); - Part::Feature* pcPart = static_cast(pcLink->getValue()); + App::Property* prop = pcMesh->getPropertyByName("Shape"); // PropertyLink + if (prop && prop->getTypeId().isDerivedFrom(App::PropertyLink::getClassTypeId())) { + App::PropertyLink* pcLink = static_cast(prop); + Part::Feature* pcPart = dynamic_cast(pcLink->getValue()); if (pcPart) { // deduct dimension from part_obj.Shape.ShapeType const TopoDS_Shape & pShape = pcPart->Shape.getShape().getShape(); - const TopAbs_ShapeEnum shapeType = pShape.ShapeType(); + const TopAbs_ShapeEnum shapeType = pShape.IsNull() ? TopAbs_SHAPE : pShape.ShapeType(); if (shapeType == TopAbs_SOLID || shapeType ==TopAbs_COMPSOLID) // COMPSOLID is solids conected by faces dimension =3; else if (shapeType == TopAbs_FACE || shapeType == TopAbs_SHELL)