Python and FindObjects() 2005-03-28 - By Bernard Lebel
Back Hello,
I have no problem using the FindObjects() command inside a script, but it always fails miserably when run from an imported module.
This is the module content:
### Module blTest.py import win32com
Application = win32com.client.Dispatch( 'XSI.Application' ) xsi = Application
oLights = xsi.FindObjects( '', '{F3705C30-5204-11D0-8298-00A0243E366B}' ) ###
Now, if I import the module (import blTest), I get this mysterious attribute error:
#ERROR : Traceback (most recent call last): # File "<Script Block >", line 1, in ? # import blTest # File "\\enigmus\xsiworkgroups\scripts\Data\Scripts\_general\xsiclasses\blHandlers \blTest.py", line 6, in ? # oLights = xsi.FindObjects( '', '{F3705C30-5204-11D0-8298-00A0243E366B}' ) # File "D:\Python23\Lib\site-packages\win32com\client\dynamic.py", line 489, in __getattr__ # raise AttributeError, "%s.%s" % (self._username_, attr) #AttributeError: XSI.Application.FindObjects # - [line 1]
Anyone has a clue might go wrong here? Everything else seems to work (like logmessage, findchildren and such), but not findobjects.
Thanks Bernard
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|