Python: Automating XSI from another application, windows

42 views
Skip to first unread message

Jules Stevenson

unread,
Dec 12, 2009, 6:47:31 AM12/12/09
to soft...@listproc.autodesk.com
Hey List,

I'm trying to talk to xsi via com from a 3rd party application, but
I'm not actually having much luck getting it to do anything at all,
essentially:

import win32com.client
app = win32com.client.Dispatch("XSI.Application")

results in the following error message:

pywintypes.com_error: (-2147024770, 'The specified module could not be
found.', None, None)
File "c:\projects\soft_automation\__init__.py", line 2, in <module>
app = win32com.client.Dispatch("XSI.Application")
File "c:\Python26\Lib\site-packages\win32com\client\__init__.py", line
95, in Dispatch
dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "c:\Python26\Lib\site-packages\win32com\client\dynamic.py", line
104, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "c:\Python26\Lib\site-packages\win32com\client\dynamic.py", line
84, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)

Which from what UI read has nothing to do with failing moldue imports,
but basically means that it can;t find 'XSI.Application'.

Anyone else had this issue? I'm wondering if it's a 64bit thing.

Any help much appreciated,

Jules

Stephen Blair

unread,
Dec 12, 2009, 6:56:44 AM12/12/09
to soft...@listproc.autodesk.com

You cannot script XSI from an external app, not like you can with Excel or Outlook, for example.
The OM is not exposed for external scripting

Check out the XSI Server example in the SDK workgroup.

Stephen Blair
Product Support Team Lead, Softimage
Montreal, Quebec, Canada
Blog | KB | Wiki

If you would like to comment on my work, please contact my manager chris....@autodesk.com.
Autodesk Subscription The smartest way to optimize your software investment.

winmail.dat

Jules Stevenson

unread,
Dec 12, 2009, 7:06:06 AM12/12/09
to soft...@listproc.autodesk.com
Thanks, but damn :).
Reply all
Reply to author
Forward
0 new messages