Skip to content

Commit

Permalink
PartDesign: [skip ci] New sketch function doesn't try any more to edi…
Browse files Browse the repository at this point in the history
…t a selected sketch
  • Loading branch information
wwmayer committed Mar 11, 2020
1 parent c1d50ec commit dce426b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Mod/PartDesign/Gui/Command.cpp
Expand Up @@ -553,20 +553,20 @@ 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");

if (PlaneFilter2.match())
PlaneFilter = PlaneFilter2;

if (SketchFilter.match()) {
Sketcher::SketchObject *Sketch = static_cast<Sketcher::SketchObject*>(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.
Expand Down

0 comments on commit dce426b

Please sign in to comment.