I have a rhino.inside console app with no UI, this opens a grasshopper document with components.
In short I do the following:
(1) The input values are not reverences to a rhino document.
(2) Before reading the ScriptVariable from a grasshopper parameter component I use the following code:
(3) Then I add the geometry to the rhino document and then save it.
This works fine with the standard grasshopper components and components I created myself in C #.
Later I noticed that the component OpenNest is not executed by my rhino.inside>grasshopper console app (it is loaded, because I can look up the component in the grasshopper document objects).
So I was wondering if some components need extra code to run in rhino.inside> Grasshopper?
In other words:
Is it enough to just use the above methods to read the parameter variables from a grasshopper document with rhino inside grasshopper without UI?
Edit:I Have also made an example C# (tested for rhino 7 )code. Note: OpenNest must be installed.RhinoInsideGrasshopperTest.zip
There is always a chance that some components will not work when run inside of a headless instance. They may need updating or in other cases they may never work.
This sounds similar to what we do in compute for working with grasshopper components. We did find that in some cases we need to call NewSolution in order to make sure everything gets processed. Here is how we are solving in compute
Unfortunately this does not seem to work.
Before starting my project I also checked if it was possible with rhino.compute to convert files like sketchup and step files to rhino, but I didn’t see this option in the list of supporting commands of the compute api (https://compute.rhino3d.com/sdk).
Are there any plans to convert cad files with rhino.compute?
After a long search I finally found the problem. The OpenNest plugin uses the: Rhino.RhinoDoc.ActiveDoc property.
Since I had not assigned a document to this property, the OpenNest plugin got an exception, This exception was not visible due to a try catch statement.