diff --git a/src/Mod/PartDesign/App/FeatureExtrude.cpp b/src/Mod/PartDesign/App/FeatureExtrude.cpp index 38c649f4f3..5059124ee3 100644 --- a/src/Mod/PartDesign/App/FeatureExtrude.cpp +++ b/src/Mod/PartDesign/App/FeatureExtrude.cpp @@ -740,7 +740,7 @@ TopoShape FeatureExtrude::generateSingleExtrusionSide(const TopoShape& sketchsha void FeatureExtrude::onDocumentRestored() { // property Type no longer has TwoLengths. - if (strcmp(Type.getValueAsString(), "TwoLengths") == 0) { + if (strcmp(Type.getValueAsString(), "?TwoLengths") == 0) { Type.setValue("Length"); Type2.setValue("Length"); SideType.setValue("Two sides"); diff --git a/src/Mod/PartDesign/App/FeaturePad.cpp b/src/Mod/PartDesign/App/FeaturePad.cpp index 5ac69345ba..687d4a5a54 100644 --- a/src/Mod/PartDesign/App/FeaturePad.cpp +++ b/src/Mod/PartDesign/App/FeaturePad.cpp @@ -38,7 +38,11 @@ using namespace PartDesign; -const char* Pad::TypeEnums[]= {"Length", "UpToLast", "UpToFirst", "UpToFace", "UpToShape", nullptr}; +// Note, TwoLengths has been deprecated by #21794. We do not remove it from the ui +// because the files store the enum index. So it is not possible to migrate files if the +// enum entry is removed (see #23612). In the distant future, when all files are reasonably +// migrated we can drop this. +const char* Pad::TypeEnums[]= {"Length", "UpToLast", "UpToFirst", "UpToFace", "?TwoLengths", "UpToShape", nullptr}; PROPERTY_SOURCE(PartDesign::Pad, PartDesign::FeatureExtrude) @@ -82,3 +86,4 @@ App::DocumentObjectExecReturn* Pad::execute() { return buildExtrusion(ExtrudeOption::MakeFace | ExtrudeOption::MakeFuse); } + diff --git a/src/Mod/PartDesign/App/FeaturePocket.cpp b/src/Mod/PartDesign/App/FeaturePocket.cpp index 614b403dcc..dec195a155 100644 --- a/src/Mod/PartDesign/App/FeaturePocket.cpp +++ b/src/Mod/PartDesign/App/FeaturePocket.cpp @@ -39,7 +39,11 @@ using namespace PartDesign; /* TRANSLATOR PartDesign::Pocket */ -const char* Pocket::TypeEnums[]= {"Length", "ThroughAll", "UpToFirst", "UpToFace", "UpToShape", nullptr}; +// Note, TwoLengths has been deprecated by #21794. We do not remove it from the ui +// because the files store the enum index. So it is not possible to migrate files if the +// enum entry is removed (see #23612). In the distant future, when all files are reasonably +// migrated we can drop this. +const char* Pocket::TypeEnums[]= {"Length", "ThroughAll", "UpToFirst", "UpToFace", "?TwoLengths", "UpToShape", nullptr}; PROPERTY_SOURCE(PartDesign::Pocket, PartDesign::FeatureExtrude) @@ -94,3 +98,4 @@ Base::Vector3d Pocket::getProfileNormal() const // turn around for pockets return res * -1; } + diff --git a/src/Mod/PartDesign/PartDesignTests/TestPad.py b/src/Mod/PartDesign/PartDesignTests/TestPad.py index 7ad4ffd40d..3a88c8a1f2 100644 --- a/src/Mod/PartDesign/PartDesignTests/TestPad.py +++ b/src/Mod/PartDesign/PartDesignTests/TestPad.py @@ -238,7 +238,7 @@ class TestPad(unittest.TestCase): self.Pad1 = self.Doc.addObject("PartDesign::Pad", "Pad1") self.Body.addObject(self.Pad1) self.Pad1.Profile = self.PadSketch1 - self.Pad1.Type = 4 + self.Pad1.Type = 5 self.Doc.recompute() self.assertAlmostEqual(self.Pad1.Shape.Volume, 2.58787, places=4)