handle exception thrown by BRepBuilderAPI_RefineModel

This commit is contained in:
wmayer
2017-07-23 15:46:57 +02:00
parent 7c1e689217
commit 488c1a1fdf
6 changed files with 57 additions and 27 deletions

View File

@@ -75,9 +75,14 @@ TopoDS_Shape FeaturePrimitive::refineShapeIfActive(const TopoDS_Shape& oldShape)
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
if (hGrp->GetBool("RefineModel", false)) {
Part::BRepBuilderAPI_RefineModel mkRefine(oldShape);
TopoDS_Shape resShape = mkRefine.Shape();
return resShape;
try {
Part::BRepBuilderAPI_RefineModel mkRefine(oldShape);
TopoDS_Shape resShape = mkRefine.Shape();
return resShape;
}
catch (Standard_Failure) {
return oldShape;
}
}
return oldShape;