[python-win32] Problem : COM with Array Argument
Rand Batchelder
randfb at yahoo.com
Mon Dec 19 23:24:00 CET 2011
I ran makepy on the DesignCad 20 type library.
I get Type mismatch errors with the function GetPoints:
a subset of the class definition is:
"""
class IDcadEntity(DispatchBaseClass):
CLSID = IID('{B4D5DA6E-EDEB-4816-BD4C-88C04C119C24}')
coclass_clsid = IID('{4FCCD850-D360-458C-8FB1-61CB90A28137}')
def GetPoint(self, iIndex=defaultNamedNotOptArg, dX=pythoncom.Missing, dY=pythoncom.Missing, dZ=pythoncom.Missing):
return self._ApplyTypes_(13, 1, (11, 0), ((2, 1), (16389, 2), (16389, 2), (16389, 2)), u'GetPoint', None,iIndex
, dX, dY, dZ)
def GetPoints(self, iStartIndex=defaultNamedNotOptArg, iCount=defaultNamedNotOptArg, pXYZArray=defaultNamedNotOptArg):
return self._ApplyTypes_(15, 1, (2, 0), ((2, 1), (2, 1), (24581, 3)), u'GetPoints', None,iStartIndex
, iCount, pXYZArray)
"""
I tried Ent.GetPoints(1,1, d)
where d is a list of 3 floats,
I get the following errors:
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python27\lib\site-packages\win32com\gen_py\DD0F69E1-1E0D-4064-94FA-2ED7ADC72C5Dx0x20x0.py", line 4631, in GetPoints
, iCount, pXYZArray)
File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 456, in _ApplyTypes_
self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args),
com_error: (-2147352571, 'Type mismatch.', None, 3)
Please advise
thanks
Rand Batchelder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20111219/8a40488e/attachment.html>
More information about the python-win32
mailing list