Sketcher: Empty list means all geometry for Python addCopy addRectangularArray and addMove
This commit is contained in:
@@ -1025,16 +1025,16 @@ PyObject* SketchObjectPy::addMove(PyObject *args)
|
||||
if (PyObject_TypeCheck(pcObj, &(PyList_Type)) ||
|
||||
PyObject_TypeCheck(pcObj, &(PyTuple_Type))) {
|
||||
std::vector<int> geoIdList;
|
||||
Py::Sequence list(pcObj);
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
if (PyLong_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
|
||||
#else
|
||||
if (PyInt_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
|
||||
#endif
|
||||
}
|
||||
Py::Sequence list(pcObj);
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
if (PyLong_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
|
||||
#else
|
||||
if (PyInt_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
|
||||
#endif
|
||||
}
|
||||
|
||||
this->getSketchObjectPtr()->addCopy(geoIdList, vect, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user