Call Rhino Command from Grasshopper C# Script

rhinocommon
grasshopper
flattensurface

#1

I would like to call commands in the Grasshopper C# Script Editor, that are available via the Rhino command line, and then get back the result, so I can go on processing it in Grasshopper. Or even better—how can I get to know the class name of a Rhino command? My concrete case here is: I want to flatten a slightly double curved surface (undevelopable). The perfectly suited Rhino command here is _UnrollSrf. But I don’t want to do that by hand. The Unroller class from the RhinoCommon SDK doesn’t perform good on non-developable surfaces. I also have the Rhino plugin RhinoResurf and could use the command _RsrMeshFlatten. Both would be okay. How would you do that?


(David Rutten) #2

Not all commands are available as methods or classes in the SDK. Sometimes, if you want to automate something, you will have to invoke the command through the Rhino command line. Unroll however seems to be available (I searched for “unroll” here)

http://developer.rhino3d.com/api/RhinoCommonWin/html/T_Rhino_Geometry_Unroller.htm