Passing data from .net to Rhinoscript


#1

Is there an example of how to do this in Rhinocommon? VB.net preferably.

Thanks,
Don


(Steve Baer) #2

Are you trying to expose functions in a plug-in to RhinoScript? If that is the case, we don’t have a RhinoCommon specific example yet, but the procedure is almost identical to how it was done in Rhino_DotNet
http://wiki.mcneel.com/developer/sdksamples/extendrhinoscript

You would override

Public Overridable Function GetPlugInObject As Object

in your plug-in class for this.


#3

it is failing on the script side when I run:
Set objArray = Rhino.GetPlugInObject(“MyScriptHere”) 'fails here

I have ComVisible set on the .net side:
<System.Runtime.InteropServices.ComVisible(True)>

I’ve been tweaking it all morning, I’m stuck.

Thanks,
Don


(Steve Baer) #4

Is “MyScriptHere” the name of your plug-in? Is your plug-in installed so Rhino knows about it?


#5

No, “MyScriptHere” was just for the example.

It is installed but somehow the name had been truncated when I went into Options>Plug-ins, I fixed that in the assembly file, and it shows up correctly in the Plug-ins list now, but it is still not working.


#6

I found the issue, at some point, somehow, I had deleted:

Public Overridable Function GetPlugInObject As Object

Thanks for your help


(Steve Baer) #7

Whew. I was scratching my head trying to figure out what the problem was here. Thanks for letting me know