From 1e615043cd9965c187061b872c4eb65e26817dad Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Sun, 7 Jul 2013 11:30:00 +0200 Subject: [PATCH] Give user feedback about not being able to extrude UpToFace if sketch is on a datum plane --- src/Mod/PartDesign/App/FeaturePad.cpp | 3 +++ src/Mod/PartDesign/App/FeaturePocket.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Mod/PartDesign/App/FeaturePad.cpp b/src/Mod/PartDesign/App/FeaturePad.cpp index 6d6288ed5b..638d69828d 100644 --- a/src/Mod/PartDesign/App/FeaturePad.cpp +++ b/src/Mod/PartDesign/App/FeaturePad.cpp @@ -157,6 +157,9 @@ App::DocumentObjectExecReturn *Pad::execute(void) TopoDS_Shape prism; std::string method(Type.getValueAsString()); if (method == "UpToFirst" || method == "UpToLast" || method == "UpToFace") { + // TODO: Write our own PrismMaker which does not depend on a solid base shape + if (base.IsNull()) + return new App::DocumentObjectExecReturn("Pad: Extruding up to a face is only possible if the sketch is located on a face"); // Note: This will return an unlimited planar face if support is a datum plane TopoDS_Face supportface = getSupportFace(); supportface.Move(invObjLoc); diff --git a/src/Mod/PartDesign/App/FeaturePocket.cpp b/src/Mod/PartDesign/App/FeaturePocket.cpp index a06da743e8..c7dbfcc1ec 100644 --- a/src/Mod/PartDesign/App/FeaturePocket.cpp +++ b/src/Mod/PartDesign/App/FeaturePocket.cpp @@ -134,6 +134,9 @@ App::DocumentObjectExecReturn *Pocket::execute(void) std::string method(Type.getValueAsString()); if (method == "UpToFirst" || method == "UpToFace") { + if (base.IsNull()) + return new App::DocumentObjectExecReturn("Pocket: Extruding up to a face is only possible if the sketch is located on a face"); + // Note: This will return an unlimited planar face if support is a datum plane TopoDS_Face supportface = getSupportFace(); supportface.Move(invObjLoc);