diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 37e9e8713..5fc915737 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -1887,6 +1887,7 @@ int SketchObject::addExternal(App::DocumentObject *Obj, const char* SubName) return -1; } + solverNeedsUpdate=true; Constraints.acceptGeometry(getCompleteGeometry()); rebuildVertexIndex(); return ExternalGeometry.getValues().size()-1; @@ -1938,7 +1939,8 @@ int SketchObject::delExternal(int ExtGeoId) ExternalGeometry.setValues(originalObjects,originalSubElements); return -1; } - + + solverNeedsUpdate=true; Constraints.setValues(newConstraints); Constraints.acceptGeometry(getCompleteGeometry()); rebuildVertexIndex(); diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index 699783f7f..6fc132b0b 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -4545,6 +4545,14 @@ public: if(autoRecompute) Gui::Command::updateActive(); + else { + // adding external geometry does not require a solve() per se (the DoF is the same), + // however a solve is required to update the amount of solver geometry, because we only + // redraw a changed Sketch if the solver geometry amount is the same as the SkethObject + // geometry amount (as this avoids other issues). + // This solver is a very low cost one anyway (there is actually nothing to solve). + static_cast(sketchgui->getObject())->solve(); + } Gui::Selection().clearSelection(); /* this is ok not to call to purgeHandler