Re: [Python.NET] Casting an object to a different interface

2016-02-29 Thread Matthias Hillenbrand
Thanks! Bryan Loyd's method of casting to an interface seems to be what I am looking for. However, I get an error in combination with the commercial API: > surfaceCB = ZOSAPI.Editors.LDE.ISurfaceCoordinateBreak(surface) E TypeError: object does not implement ISurfaceCoordinateBrea

Re: [Python.NET] Casting an object to a different interface

2016-02-25 Thread Denis Akhiyarov
simple google search revealed this example from Bryan Lloyd for casting to interface: https://mail.python.org/pipermail/pythondotnet/2007-December/000753.html Let us know if it works: >* from mynamespace import Foo, Iface *> >* inst = Foo() # create an instance *> >* wrapped = Iface(inst) # 'cas

[Python.NET] Casting an object to a different interface

2016-02-23 Thread Matthias Hillenbrand
Hi, The Python win32com module for accessing COM objects provides a method CastTo for casting an object to a different interface. Similarly, in my application, I have to cast an object to another .Net interface. Does Python.Net provide such a method or can you describe a way of doing the cast