In [68]:
import Part
class MyFeature(Part.BSplineSurface):
    pass


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-68-567b8dcd0a12> in <module>()
      1 import Part
----> 2 class MyFeature(Part.BSplineSurface):
      3     pass

TypeError: Error when calling the metaclass bases
    type 'Part.GeomBSplineSurface' is not an acceptable base type

In [66]:
import FreeCAD as App
class MyVector(App.Rotation):
    pass


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-66-8d4a3265a879> in <module>()
      1 import FreeCAD as App
----> 2 class MyVector(App.Rotation):
      3     pass

TypeError: Error when calling the metaclass bases
    type 'Base.Rotation' is not an acceptable base type

C++ Subclass Problem


In [2]:
import eigen
class MyEigenVector(eigen.vector3):
    def size(self):
        return 4

In [3]:
a = MyEigenVector([1,2,3])
b = eigen.vector3([1,2,3])

In [11]:
a.size()


Out[11]:
4

In [5]:
b.size()


Out[5]:
3L

In [7]:
len(a)


Out[7]:
3

In [8]:
len(b)


Out[8]:
3

PROBLEM: eigen.vector3 (python) is the wrapped Eigen::Vector3d (c++). The method "size" calls the method "size" of the c++ object. len also calls the c++ method size. But overwriting the method size won't change the result of len.


In [ ]: