diff --git a/src/Base/GeometryPyCXX.h b/src/Base/GeometryPyCXX.h index 8226918845..8dfd6cf9f8 100644 --- a/src/Base/GeometryPyCXX.h +++ b/src/Base/GeometryPyCXX.h @@ -185,11 +185,12 @@ public: } operator T() const { - // cast the PyObject pointer to the matching sub-class - // and call then the defined member function + return getValue(); + } + PyT* getPy() const + { PyT* py = static_cast(ptr()); - T* v = (py->*valuePtr)(); - return *v; + return py; } private: