[python-win32] MemoryError: CreatingSafeArray

Dalius Dobravolskas dalius at sandbox.lt
Tue Jul 7 11:02:32 CEST 2009


Hello,

I'm trying to use Bentley MicroStation using COM and I met this problem. 
It looks like I have met the same or very similar problem as here:
http://mail.python.org/pipermail/python-win32/2007-January/005453.html

Required argument is 24612 but if I pass list (or tuple) of required 
records it fails. Here is excerpt from python prompt:

 >>> o1 = win32com.client.Record("Point3d", ms)
 >>> o1.x = 0
 >>> o1.y = 0
 >>> o2 = win32com.client.Record("Point3d", ms)
 >>> o2.x = 1
 >>> o2.y = 0
 >>> o3 = win32com.client.Record("Point3d", ms)
 >>> o3.x = 0
 >>> o3.y = 1
 >>> ms.CreateShapeElement1(None, [o1, o2, o3], 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File 
"c:\Python26\lib\site-packages\win32com\gen_py\CF9F97BF-39F2-4B8E-835C-8B
E9E99DAF5Bx0x8x0.py", line 2403, in CreateShapeElement1
    , Vertices, FillMode)
  File "c:\Python26\lib\site-packages\win32com\client\__init__.py", line 
456, in
 _ApplyTypes_
    self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args),
MemoryError: CreatingSafeArray

Any ideas where I could start? What information from my side would help? 
I know this stuff works both with C# and VBA.

Related entries from gen_py/*.py file:

    def CreateShapeElement1(self, Template=defaultNamedNotOptArg, 
Vertices=defaultNamedNotOptArg, FillMode=-1):
        return self._ApplyTypes_(1610743983, 1, (9, 0), ((9, 1), (24612, 
3), (3, 49)), u'CreateShapeElement1', 
'{EA775B29-7513-482D-8260-47B8B2E5E1A8}',Template
            , Vertices, FillMode)

    (( u'CreateShapeElement1' , u'Template' , u'Vertices' , u'FillMode' 
, u'pVal' ,
            ), 1610743983, (1610743983, (), [ (9, 1, None, 
"IID('{C9F8AC07-4FD2-496B-B9F0-EDD75A0551C0}')") , (24612, 3, None, 
None) , (3, 49, '-1', None) , (16393, 10, None, 
"IID('{EA775B29-7513-482D-8260-47B8B2E5E1A8}')") , ], 1 , 1 , 4 , 0 , 
728 , (3, 0, None, None) , 0 , )),


Regards,
Dalius


More information about the python-win32 mailing list