From 7803740edd3dfb0e95c1bb8d3d80eadf07051f6b 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 aa22c8c4a09f..f1d0c6215840 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; }