[python-win32] Some problems with instantiating a type library
Tim Roberts
timr at probo.com
Fri Feb 15 22:26:53 CET 2008
pierre wrote:
> Hi, i'm trying to make use of win32 and makepy for automatizing the CAD/CAMsoftware Rhino3D.
>
> I'm beginning with something like this:
>
> import win32com.client
> from RSInterface import RhinoScript #Interface made by makepy from the RhinoScript type library
>
> Rhino = win32com.client.Dispatch('Rhino4.Application')
> Rhino.Visible = True
>
> #this works and launches rhino but not the following
>
> RS = Rhino.GetScriptObject
>
This is a function, not a property. Unlike VB, function calls in Python
must have the parens:
RS = Rhino.GetScriptObject()
However, their knowledge base mentions that it can take quite a long
time before it loads the RhinoScript plugin. They suggest retrying the
GetScriptObject call in a loop with a delay:
http://en.wiki.mcneel.com/default.aspx/McNeel/Rhino4Automation
It shouldn't be hard to convert that to Python.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list