pierre cutellic wrote:
> Well, I tried this way first,
> but this is not working, and that's why i'm a bit stuck.
>
> import win32com.client, time
> Rhino = win32com.client.Dispatch('Rhino4.Application')
> time.sleep(1)
> Rhino.Visible = True
> RS = Rhino.GetScriptObject()
>
> *It returns:
>
> *RS = Rhino.GetScriptObject()
> File "C:\Python24\lib\site-packages\win32com\client\dynamic.py", line
> 172, in __call__
> return
> self._get_good_object_(self._oleobj_.Invoke(*allArgs),self._olerepr_.defaultDispatchName,None)
> pywintypes.com_error: (-2147352573, 'Membre introuvable.', None, None)*
> *
I thought you said this was working!
It may be that 1 second is not enough. Remember that the web page I
quoted was doing this in a loop, retrying and delaying until it
succeeded. You could do the same thing by doing something like:
import pywintypes
...
gotit = False
while not gotit:
try:
RS = Rhino.GetScriptObject()
gotit = True
except pywintype.com_error:
time.sleep(1)
print "Retrying"
--
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32