diff --git a/src/Mod/Sketcher/App/SketchObjectPy.xml b/src/Mod/Sketcher/App/SketchObjectPy.xml index 5554dc1c0f..ff6fc48cc4 100644 --- a/src/Mod/Sketcher/App/SketchObjectPy.xml +++ b/src/Mod/Sketcher/App/SketchObjectPy.xml @@ -494,6 +494,46 @@ If there is no such constraint an exception is raised. + + + + Return the DoFs of the current solved sketch + + + + + + + + Return a list of integers indicating the constraints detected as conflicting + + + + + + + + Return a list of integers indicating the constraints detected as redundant + + + + + + + + Return a list of integers indicating the constraints detected as partially redundant + + + + + + + + Return a list of integers indicating the constraints detected as malformed + + + + sets the GeometryId of the SketchGeometryExtension of the geometry with the provided GeoId diff --git a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp index 4151b5a422..64542b2ad2 100644 --- a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp @@ -2152,6 +2152,64 @@ PyObject* SketchObjectPy::setGeometryId(PyObject* args) Py_Return; } +Py::Long SketchObjectPy::getDoF() const +{ + auto dofs = this->getSketchObjectPtr()->getLastDoF(); + + return Py::Long(dofs); +} + +Py::List SketchObjectPy::getConflictingConstraints() const +{ + auto conflictinglist = this->getSketchObjectPtr()->getLastConflicting(); + + Py::List conflicting; + + for (auto cid : conflictinglist) { + conflicting.append(Py::Int(cid)); + } + + return conflicting; +} + +Py::List SketchObjectPy::getRedundantConstraints() const +{ + auto redundantlist = this->getSketchObjectPtr()->getLastRedundant(); + + Py::List redundant; + + for (auto cid : redundantlist) { + redundant.append(Py::Int(cid)); + } + + return redundant; +} + +Py::List SketchObjectPy::getPartiallyRedundantConstraints() const +{ + auto redundantlist = this->getSketchObjectPtr()->getLastPartiallyRedundant(); + + Py::List redundant; + + for (auto cid : redundantlist) { + redundant.append(Py::Int(cid)); + } + + return redundant; +} + +Py::List SketchObjectPy::getMalformedConstraints() const +{ + auto malformedlist = this->getSketchObjectPtr()->getLastMalformedConstraints(); + + Py::List malformed; + + for (auto cid : malformedlist) { + malformed.append(Py::Int(cid)); + } + + return malformed; +} PyObject* SketchObjectPy::getCustomAttributes(const char* /*attr*/) const {