[python-win32] Autocad automation via COM

Petr Dlabal dlabal at gmail.com
Thu Jun 5 12:44:46 CEST 2008


Hello,
I'm new in this mailing list.
I'd like to discuss this problem with pywin32 and autocad:
autocad awaiting parameters to functions as variants, but in fact, it
must be for example array of doubles x,y,z.
The problem and some fix by patching build.py script is described
here: http://www.mail-archive.com/python-win32@python.org/msg01445.html

Descibed fix (by AutocadTranslateMap) works fine, except in one (or
two) situations:
Autocad ActiveViewport.SnapBasePoint property awaiting 2-element array
of doubles x,y (unlike many other functions awaiting 3-element array
of doubles x,y,z).
In this situation it fails and autocad raises error about wrong
parameter. If you print ActiveViewport.SnapBasePoint you will get
(0.0,0.0).

In Dan Glassman's fix
(http://www.mail-archive.com/python-win32@python.org/msg01445.html) in
AutocadTranslateMap you can see snapbasepoint parameter here with 8197
type, which I think is array of doubles.

I don't understand COM, I'm not programmer, I'm only user, so please,
can somebody help me with this problem? I can send patched build.py
(patched as described in
http://www.mail-archive.com/python-win32@python.org/msg01445.html) and
I can send gencache file
gen_py/EE2303F2-4EF6-42F6-92AB-4241221FF278x0x2x5.py where you can see
defined "SnapBasePoint": ((13, LCID, 4, 0),()),... and in other places
(I don't fully understand what it means).

Thank you very much for any information / help.

PD


More information about the python-win32 mailing list