diff --git a/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp b/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp index 0df2611b78..36844f3fea 100644 --- a/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp +++ b/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp @@ -117,9 +117,16 @@ void SurfaceOfExtrusionPy::setDirection(Py::Object arg) } } +namespace Part { + extern const Py::Object makeGeometryCurvePy(const Handle(Geom_Curve)& c); +} + Py::Object SurfaceOfExtrusionPy::getBasisCurve(void) const { - throw Py::Exception(PyExc_NotImplementedError, "Not yet implemented"); + Handle(Geom_SurfaceOfLinearExtrusion) surf = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast + (getGeometryPtr()->handle()); + Handle(Geom_Curve) curve = surf->BasisCurve(); + return makeGeometryCurvePy(curve); } void SurfaceOfExtrusionPy::setBasisCurve(Py::Object arg) diff --git a/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp b/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp index fbb6fe20e1..996ec57e18 100644 --- a/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp +++ b/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp @@ -144,9 +144,16 @@ void SurfaceOfRevolutionPy::setDirection(Py::Object arg) } } +namespace Part { + extern const Py::Object makeGeometryCurvePy(const Handle(Geom_Curve)& c); +} + Py::Object SurfaceOfRevolutionPy::getBasisCurve(void) const { - throw Py::Exception(PyExc_NotImplementedError, "Not yet implemented"); + Handle(Geom_SurfaceOfRevolution) surf = Handle(Geom_SurfaceOfRevolution)::DownCast + (getGeometryPtr()->handle()); + Handle(Geom_Curve) curve = surf->BasisCurve(); + return makeGeometryCurvePy(curve); } void SurfaceOfRevolutionPy::setBasisCurve(Py::Object arg)