From 45ce3b78227ba64df3d84ea67d34cd4548697f2a Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Fri, 13 Sep 2013 19:35:36 +0200 Subject: [PATCH] Enable Python to read the value of a sketcher constraint --- src/Mod/Sketcher/App/ConstraintPy.xml | 8 +++++++- src/Mod/Sketcher/App/ConstraintPyImp.cpp | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/App/ConstraintPy.xml b/src/Mod/Sketcher/App/ConstraintPy.xml index d46c5b471..06750f994 100644 --- a/src/Mod/Sketcher/App/ConstraintPy.xml +++ b/src/Mod/Sketcher/App/ConstraintPy.xml @@ -14,7 +14,7 @@ - With this objects you can handle sketches + With this object you can handle sketches @@ -28,6 +28,12 @@ + + + Value of the Constraint + + + Name of the constraint diff --git a/src/Mod/Sketcher/App/ConstraintPyImp.cpp b/src/Mod/Sketcher/App/ConstraintPyImp.cpp index 84b168767..a7d980956 100644 --- a/src/Mod/Sketcher/App/ConstraintPyImp.cpp +++ b/src/Mod/Sketcher/App/ConstraintPyImp.cpp @@ -503,6 +503,11 @@ void ConstraintPy::setName(Py::String arg) this->getConstraintPtr()->Name = arg; } +Py::Float ConstraintPy::getValue(void) const +{ + return Py::Float(this->getConstraintPtr()->getValue()); +} + PyObject *ConstraintPy::getCustomAttributes(const char* /*attr*/) const { return 0;