algorithmic modeling for Rhino
Hello David, Giulio and all the rest.
This is a follow_up of Issue
http://www.grasshopper3d.com/forum/topics/grasshopper-misbehaves-wh...
It seems that when Rhino and GH are automated by using them as an ActiveX, the C# script object fails on the simplest tasks. That is, when initiating Rhino and GH externally (as by the following C# code):
Rhino5Application rhino_app = new Rhino5Application();
dynamic grasshopper = newRhino.rhino_app.GetPlugInObject("b45a29b1-4343-4035-989e-044e8580d9cf", "00000000-0000-0000-0000-000000000000") as dynamic;
The following very simple C# script component fails because it cant cast its input:
The c# code at the component is only:
Line 89 is simply casting of the input. Clearly, this makes the usage of C# component, under automation, impossible which is a major loss.
As said, when initiating Rhino and GH manually , all works well as in the following:
Any ideas why it misbehaves under automation (as an Active X ) ?
I added the gh file of this example.
Tags:
Weird. I have no idea what could be causing this or whether the error is really what it appears to be. Does it work when you set the typehint for x to Point3d?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Or this error is not what it claims it is. I can already see this is going to be hell to debug. One last quick test, can you translate the small script with the casting error to VB.NET and see if you get the same error?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hello David, thanx for your help and sorry for the "hell to debug" issue :)
The same error occurs in VB.Net component.
Under Automation I get:
This time it reports on the line number at the end of the "DrawViewportWires" function.
and when ran "manually", all works well:
Welcome to
Grasshopper
© 2025 Created by Scott Davidson.
Powered by