From 6a1863fe52c5151880e00fd6e7c90dc08670b593 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 22 Jun 2019 06:42:21 +0200 Subject: [PATCH] Sketcher: Python interface to contraints' activated state --- src/Mod/Sketcher/App/ConstraintPy.xml | 10 ++++++++-- src/Mod/Sketcher/App/ConstraintPyImp.cpp | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/App/ConstraintPy.xml b/src/Mod/Sketcher/App/ConstraintPy.xml index 5ef77d5aaa..88e8461ec6 100644 --- a/src/Mod/Sketcher/App/ConstraintPy.xml +++ b/src/Mod/Sketcher/App/ConstraintPy.xml @@ -44,13 +44,13 @@ Position of second geometry index the Constraint refers to - + Third geometry index the Constraint refers to - + @@ -82,5 +82,11 @@ + + + Returns whether the constraint active (enforced) or not + + + diff --git a/src/Mod/Sketcher/App/ConstraintPyImp.cpp b/src/Mod/Sketcher/App/ConstraintPyImp.cpp index 076ef24778..25a24c7d86 100644 --- a/src/Mod/Sketcher/App/ConstraintPyImp.cpp +++ b/src/Mod/Sketcher/App/ConstraintPyImp.cpp @@ -707,6 +707,11 @@ Py::Boolean ConstraintPy::getInVirtualSpace(void) const return Py::Boolean(this->getConstraintPtr()->isInVirtualSpace); } +Py::Boolean ConstraintPy::getIsActive(void) const +{ + return Py::Boolean(this->getConstraintPtr()->isActive); +} + PyObject *ConstraintPy::getCustomAttributes(const char* /*attr*/) const { return 0;