Sketcher: Implement Python function getConstruction(geoId) to retrieve geometry construction status
This commit is contained in:
committed by
abdullahtahiriyo
parent
3a845e4d07
commit
c79ac8d1fc
@@ -48,6 +48,11 @@
|
||||
<UserDocu>set construction mode of a geometry on or off</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getConstruction">
|
||||
<Documentation>
|
||||
<UserDocu>returns the construction mode of a geometry</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="addConstraint">
|
||||
<Documentation>
|
||||
<UserDocu>add a constraint to the sketch</UserDocu>
|
||||
|
||||
@@ -280,6 +280,24 @@ PyObject* SketchObjectPy::setConstruction(PyObject *args)
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* SketchObjectPy::getConstruction(PyObject *args)
|
||||
{
|
||||
int Index;
|
||||
if (!PyArg_ParseTuple(args, "i", &Index))
|
||||
return 0;
|
||||
|
||||
auto gf = this->getSketchObjectPtr()->getGeometryFacade(Index);
|
||||
|
||||
if(gf)
|
||||
return Py::new_reference_to(Py::Boolean(gf->getConstruction()));
|
||||
|
||||
std::stringstream str;
|
||||
str << "Not able to retrieve construction mode of a geometry with the given index: " << Index;
|
||||
PyErr_SetString(PyExc_ValueError, str.str().c_str());
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
PyObject* SketchObjectPy::addConstraint(PyObject *args)
|
||||
{
|
||||
PyObject *pcObj;
|
||||
|
||||
Reference in New Issue
Block a user