|
From: Kelie <kf...@gm...> - 2008-04-03 17:51:13
|
Hello group,
I'm getting an error when trying to launch AutoCAD using comtypes. The
application does get started. But the variable 'app' does not seem to hold a
valid instance of it, because I was not able to access its properties such as
ActiveDocument, WindowState, etc..
This is copied from Python shell:
>>> import comtypes
>>> comtypes.__version__
'0.4.2'
>>> app = comtypes.client.CreateObject("AutoCAD.Application")
# Generating comtypes.gen.AutoCAD
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Programming\Python\Install\comtypes\comtypes\client\__init__.py",
line 202, in CreateObject
return _manage(obj, clsid, interface=interface)
File "C:\Programming\Python\Install\comtypes\comtypes\client\__init__.py",
line 170, in _manage
obj = GetBestInterface(obj)
File "C:\Programming\Python\Install\comtypes\comtypes\client\__init__.py",
line 133, in GetBestInterface
interface = getattr(mod, itf_name)
AttributeError: 'module' object has no attribute 'IAcadApplication'
Any idea why?
(btw, if I remember correctly, I didn't used to get this error. But I was using
an earlier version comtypes and an earlier version of AutoCAD.)
Thanks.
|