newbie: passing array to AutoCad through COM

H

H vd Horst

I know this is an old topic and addressed before.I Googled and found
some old messages about this and other programs as well, but never read
about an actual solution.

I'm new to Python and haven't done much programming in a long time.
I want to use it to generate objects in drawings and analyze them from
outside of VBA AutoLisp.
Sending and retrieving strings and integers does work.

I can also get arrays from the program ie.returns
(453.81901618016582, 422.54691828835212, 0.0)

But when I send an array wether Tuple or List I get an error.
returns
Traceback (most recent call last): File "<interactive input>", line 1,
in ? File "C:\Python24\lib\site-packages\win32com\gen_py\1EFD8E85-7F3B-
48E6-9341-3C8B2F60136Bx0x1x1\IAcadModelSpace.py", line 267, in AddPoint
ret = self._oleobj_.InvokeTypes(1562, LCID, 1, (9, 0), ((12, 1),),Point)
com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0,
-2147024809), None)

I tried the same thing in IntelliCad and no problems there thanks to a
slightly different object model. You have to declare a point Object you
use as input for a -cartesian- coordinate.

AutoCad just regards every input as a variant as far as I can see

What am I doing wrong? Still working on understanding the mechanisms
Is there a -simple/easy- way to pass those coordinates to Acad?

thanks, Hans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top