From dce426bf8fdf9b08678e1ed3b34dba5038bacb70 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 11 Mar 2020 15:14:18 +0100 Subject: [PATCH] PartDesign: [skip ci] New sketch function doesn't try any more to edit a selected sketch --- src/Mod/PartDesign/Gui/Command.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 0928ffe6d595..e9b8d7f6969c 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -553,7 +553,12 @@ void CmdPartDesignNewSketch::activated(int iMsg) return; } - Gui::SelectionFilter SketchFilter("SELECT Sketcher::SketchObject COUNT 1"); + // Hint: + // The behaviour of this command has changed with respect to a selected sketch: + // It doesn't try any more to edit a selected sketch but always tries to create + // a new sketch. + // See https://forum.freecadweb.org/viewtopic.php?f=3&t=44070 + Gui::SelectionFilter FaceFilter ("SELECT Part::Feature SUBELEMENT Face COUNT 1"); Gui::SelectionFilter PlaneFilter ("SELECT App::Plane COUNT 1"); Gui::SelectionFilter PlaneFilter2("SELECT PartDesign::Plane COUNT 1"); @@ -561,12 +566,7 @@ void CmdPartDesignNewSketch::activated(int iMsg) if (PlaneFilter2.match()) PlaneFilter = PlaneFilter2; - if (SketchFilter.match()) { - Sketcher::SketchObject *Sketch = static_cast(SketchFilter.Result[0][0].getObject()); - // openCommand("Edit Sketch"); - PartDesignGui::setEdit(Sketch,pcActiveBody); - } - else if ( FaceFilter.match() || PlaneFilter.match() ) { + if ( FaceFilter.match() || PlaneFilter.match() ) { if (!pcActiveBody) { // We shouldn't make a new Body in this case, because that means // the source shape of the face/plane would be outside the Body.