diff --git a/src/Mod/Sketcher/App/SketchObjectPy.xml b/src/Mod/Sketcher/App/SketchObjectPy.xml index 451cc6160b..0082e13a0d 100644 --- a/src/Mod/Sketcher/App/SketchObjectPy.xml +++ b/src/Mod/Sketcher/App/SketchObjectPy.xml @@ -178,6 +178,13 @@ If there is no such constraint an exception is raised. + + + + (geoId, posId) = getGeoVertexIndex(index) - retrieve the GeoId and PosId of a point in the sketch + + + diff --git a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp index bdac073e1b..2736fdd9ea 100644 --- a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp @@ -941,6 +941,22 @@ PyObject* SketchObjectPy::movePoint(PyObject *args) } +PyObject* SketchObjectPy::getGeoVertexIndex(PyObject *args) +{ + int index; + if (!PyArg_ParseTuple(args, "i", &index)) + return 0; + + SketchObject* obj = this->getSketchObjectPtr(); + int geoId; + PointPos posId; + obj->getGeoVertexIndex(index, geoId, posId); + Py::Tuple tuple(2); + tuple.setItem(0, Py::Long(geoId)); + tuple.setItem(1, Py::Long(posId)); + return Py::new_reference_to(tuple); +} + PyObject* SketchObjectPy::getPoint(PyObject *args) { int GeoId, PointType;