How can I reference Grasshopper.dll assembly in Unity?

Hi,

I’m trying to integrate Rhino.Inside® into a Unity3D application. I have used the Sample project. But I found I can’t use Grasshopper API if I just copied the “Grasshopper.dll” into Unity Asset folder along with “RhinoCommon” dll. The “Grasshopper.dll” can not be loaded. I had following message:


Assembly 'Assets/Standard Assets/RhinoInside/Grasshopper.dll' will not be loaded due to errors:
Unable to resolve reference 'Microsoft.VisualBasic'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'Eto'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'Mono.Cecil'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'GH_Util'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'QWhale.Editor'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'QWhale.Syntax.Parsers'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'Yak'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'Eto.Wpf'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'Rhino.UI'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'QWhale.Common'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'QWhale.Syntax'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.

I also managed to copy all the files above or use a csc.rsp file, but it doesn’t work at all.

Moved to the Serengeti > Inside category.

I have been experimenting with this and have concluded, along with @kike that this is not a good use case for Rhino.Inside. I went through all of the same attempts as you:

  • Copying the Grasshopper.dll into the project assets folder
  • Copying other dependencies into the folder
  • attempting to use the csc.rsp
  • Using assembly resolving
  • etc…

The idea for all of these attempts, unfortunately, are based on bad assumptions that I had about how Unity dealt with .Net dlls, and by being blinded by the awesome Sample that @kike posted with the help of @LongNguyen.

I go into further detail in this post: https://github.com/mcneel/rhino.inside/issues/121#issuecomment-509997598

The reason this is not a good use case for Rhino.Inside is that the potential solutions which involve Rhino.Inside (described in the link) circumvent the primary benefit of Rhino.Inside, namely having RhinoCommon and Grasshopper’s APIs next to the Unity API.

There are other ‘established’ solutions that we’ve seen in the past, including using networking technology to pass data to Unity. There are a few projects under development from 3rd party devs that address this workflow, including the Speckle client for Unity, and Rhino.Compute + RESTHopper.

Thank you for the answer. I have give up the Unity as application.