From 70857e17e0f68489b58180713bbc6edc43050a08 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Fri, 30 Aug 2019 11:02:16 +0800 Subject: [PATCH] Sketcher: fix missing update on expression change --- src/Mod/Sketcher/App/SketchObject.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 2a9d407239..4a1264a69d 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -89,6 +89,7 @@ using namespace Sketcher; using namespace Base; +FC_LOG_LEVEL_INIT("Sketch",true,true); const int GeoEnum::RtPnt = -1; const int GeoEnum::HAxis = -1; @@ -6861,8 +6862,19 @@ void SketchObject::setExpression(const App::ObjectIdentifier &path, boost::share { DocumentObject::setExpression(path, expr); - if(noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver, constraints and UI + if(noRecomputes) {// if we do not have a recompute, the sketch must be solved to update the DoF of the solver, constraints and UI + try { + auto res = ExpressionEngine.execute(); + if(res) { + FC_ERR("Failed to recompute " << ExpressionEngine.getFullName() << ": " << res->Why); + delete res; + } + } catch (Base::Exception &e) { + e.ReportException(); + FC_ERR("Failed to recompute " << ExpressionEngine.getFullName() << ": " << e.what()); + } solve(); + } } int SketchObject::autoConstraint(double precision, double angleprecision, bool includeconstruction)