Author Topic: Python and Automation (for Python/COM people)  (Read 2800 times)

Rob7795

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Python and Automation (for Python/COM people)
« on: July 07, 2003, 12:32:19 am »
I'm trying to get access to the automation service for EA via Pythin and am nearly there.  However, a big showstopper is that I get an error when I try to iterate through the "models" property of the repository.  I get the error message below (at end) complaining about "GetAt" not existing in the interface of the COM object.

I don't have a problem in VBscript within a Word Macro, so the Automation Server itself seems to be OK.  I'm sure it's just a python thing.

It does appear to be any collection, or rather, "DualCollection" as exposed through the COM interface ("authors", etc, have the same problem).

Any help would be greatly appreciated.

Thanks in advance, Rob.
----------------------------------------------------
error message from Python console below:
-------
Traceback (most recent call last):
 File "C:\Python22\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 307, in RunScript
   debugger.run(codeObject, __main__.__dict__, start_stepping=0)
 File "C:\Python22\lib\site-packages\Pythonwin\pywin\debugger\__init__.py", line 60, in run
   _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
 File "C:\Python22\lib\site-packages\Pythonwin\pywin\debugger\debugger.py", line 591, in run
   exec cmd in globals, locals
 File "H:\backups\word.py", line 20, in ?
   m = modelList.GetAt(0)
 File "c:\Python22\Lib\site-packages\EnterpriseArchitect.py", line 856, in GetAt
   ret = self._oleobj_.InvokeTypes(0, LCID, 1, (9, 0), ((2, 1),),index)
com_error: (-2147352573, 'Member not found.', None, None)
>>>