Sketcher: Python command to delete all the constraints at once

This commit is contained in:
Abdullah Tahiri
2018-07-14 07:32:23 +02:00
committed by wmayer
parent 6e865aa3e5
commit 9f969e558c
2 changed files with 20 additions and 1 deletions

View File

@@ -33,6 +33,11 @@
<UserDocu>delete all the geometry objects and constraints from the sketch except external geometry</UserDocu>
</Documentation>
</Methode>
<Methode Name="deleteAllConstraints">
<Documentation>
<UserDocu>delete all the constraints from the sketch</UserDocu>
</Documentation>
</Methode>
<Methode Name="toggleConstruction">
<Documentation>
<UserDocu>switch a geometry to a construction line</UserDocu>

View File

@@ -217,7 +217,7 @@ PyObject* SketchObjectPy::deleteAllGeometry(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
if (this->getSketchObjectPtr()->deleteAllGeometry()) {
std::stringstream str;
str << "Unable to delete Geometry";
@@ -228,6 +228,20 @@ PyObject* SketchObjectPy::deleteAllGeometry(PyObject *args)
Py_Return;
}
PyObject* SketchObjectPy::deleteAllConstraints(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
if (this->getSketchObjectPtr()->deleteAllConstraints()) {
std::stringstream str;
str << "Unable to delete Constraints";
PyErr_SetString(PyExc_ValueError, str.str().c_str());
return 0;
}
Py_Return;
}
PyObject* SketchObjectPy::toggleConstruction(PyObject *args)