From 60c634c275925e74744e2604e1cf7a71981e8a2e Mon Sep 17 00:00:00 2001 From: David Osterberg Date: Mon, 15 Feb 2021 17:46:58 +0100 Subject: [PATCH] PartDesign: Subtractive Loft. Raise error when base is null. Previously Subtractive loft would create a shape if there is no base object. This is because the code is shared with Additive Loft, where that is the right thing to do. Now we check for this, and return error if there is nothing to subtract from. --- src/Mod/PartDesign/App/FeatureLoft.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/PartDesign/App/FeatureLoft.cpp b/src/Mod/PartDesign/App/FeatureLoft.cpp index aa22c8c4a0..f1d0c62158 100644 --- a/src/Mod/PartDesign/App/FeatureLoft.cpp +++ b/src/Mod/PartDesign/App/FeatureLoft.cpp @@ -179,6 +179,9 @@ App::DocumentObjectExecReturn *Loft::execute(void) AddSubShape.setValue(result); if(base.IsNull()) { + if (getAddSubType() == FeatureAddSub::Subtractive) + return new App::DocumentObjectExecReturn("Loft: There is nothing to subtract from\n"); + Shape.setValue(getSolid(result)); return App::DocumentObject::StdReturn; }