diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index dd65c3a281..bd8e4a7878 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -5839,6 +5839,15 @@ int SketchObject::changeConstraintsLocking(bool bLock) return cntSuccess; } +bool SketchObject::constraintHasExpression(int constrid) +{ + App::ObjectIdentifier spath = this->Constraints.createPath(constrid); + + App::PropertyExpressionEngine::ExpressionInfo expr_info = this->getExpression(spath); + + return (expr_info.expression != 0); +} + /*! * \brief SketchObject::port_reversedExternalArcs finds constraints that link to endpoints of external-geometry arcs, diff --git a/src/Mod/Sketcher/App/SketchObject.h b/src/Mod/Sketcher/App/SketchObject.h index cb44ae4eb8..13ad9f4058 100644 --- a/src/Mod/Sketcher/App/SketchObject.h +++ b/src/Mod/Sketcher/App/SketchObject.h @@ -265,6 +265,8 @@ public: bool isPointOnCurve(int geoIdCurve, double px, double py); double calculateConstraintError(int ConstrId); int changeConstraintsLocking(bool bLock); + /// returns whether a given constraint has an associated expression or not + bool constraintHasExpression(int constrid); ///porting functions int port_reversedExternalArcs(bool justAnalyze);