[Sketcher] add python command sketch.getGeoVertexIndex(int index) -- returns tuple (geoId, posId) of vertex at that index in the sketch. usage example: (geoId, posId) = App.ActiveDocument.Sketch.getGeoVertexIndex(int(Gui.Selection.getSelectionEx()[0].SubElementNames[0][6:])-1)
This commit is contained in:
committed by
abdullahtahiriyo
parent
71e1f7c331
commit
2bfc6301bc
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user