diff --git a/src/Mod/Part/App/Part2DObjectPy.xml b/src/Mod/Part/App/Part2DObjectPy.xml index 7172b2fb9..782e28c69 100644 --- a/src/Mod/Part/App/Part2DObjectPy.xml +++ b/src/Mod/Part/App/Part2DObjectPy.xml @@ -13,5 +13,10 @@ This object represents a 2D Shape in a 3D World + + + Reposition object based on Support, MapMode and MapPathParameter properties. + + diff --git a/src/Mod/Part/App/Part2DObjectPyImp.cpp b/src/Mod/Part/App/Part2DObjectPyImp.cpp index ba7ceba8f..13ad5ef40 100644 --- a/src/Mod/Part/App/Part2DObjectPyImp.cpp +++ b/src/Mod/Part/App/Part2DObjectPyImp.cpp @@ -2,6 +2,7 @@ #include "PreCompiled.h" #include "Mod/Part/App/Part2DObject.h" +#include "OCCError.h" // inclusion of the generated files (generated out of Part2DObjectPy.xml) #include "Part2DObjectPy.h" @@ -15,6 +16,23 @@ std::string Part2DObjectPy::representation(void) const return std::string(""); } +PyObject* Part2DObjectPy::positionBySupport(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return 0; + try{ + this->getPart2DObjectPtr()->positionBySupport(); + } catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + PyErr_SetString(PartExceptionOCCError, e->GetMessageString()); + return NULL; + } catch (Base::Exception &e) { + PyErr_SetString(Base::BaseExceptionFreeCADError, e.what()); + return NULL; + } + Py_INCREF(Py_None); + return Py_None; +} PyObject *Part2DObjectPy::getCustomAttributes(const char* /*attr*/) const