Sketcher: Expose mass datum commands to python

This commit is contained in:
Abdullah Tahiri
2018-11-01 14:08:03 +01:00
committed by Yorik van Havre
parent 2c41e70c91
commit fe78c1a037
2 changed files with 44 additions and 0 deletions

View File

@@ -98,6 +98,16 @@
<UserDocu>set the Driving status of a datum constraint</UserDocu>
</Documentation>
</Methode>
<Methode Name="setDatumsDriving">
<Documentation>
<UserDocu>set the Driving status of datum constraints</UserDocu>
</Documentation>
</Methode>
<Methode Name="moveDatumsToEnd">
<Documentation>
<UserDocu>Moves all datum constraints to the end of the constraint list</UserDocu>
</Documentation>
</Methode>
<Methode Name="getDriving">
<Documentation>
<UserDocu>Get the Driving status of a datum constraint</UserDocu>

View File

@@ -727,6 +727,40 @@ PyObject* SketchObjectPy::setDriving(PyObject *args)
Py_Return;
}
PyObject* SketchObjectPy::setDatumsDriving(PyObject *args)
{
PyObject* driving;
if (!PyArg_ParseTuple(args, "O!", &PyBool_Type, &driving))
return 0;
if (this->getSketchObjectPtr()->setDatumsDriving(PyObject_IsTrue(driving) ? true : false)) {
std::stringstream str;
str << "Not able set all dimensionals driving/refernce";
PyErr_SetString(PyExc_ValueError, str.str().c_str());
return 0;
}
Py_Return;
}
PyObject* SketchObjectPy::moveDatumsToEnd(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
if (this->getSketchObjectPtr()->moveDatumsToEnd()) {
std::stringstream str;
str << "Not able move all dimensionals to end";
PyErr_SetString(PyExc_ValueError, str.str().c_str());
return 0;
}
Py_Return;
}
PyObject* SketchObjectPy::getDriving(PyObject *args)
{
int constrid;