algorithmic modeling for Rhino

I was try to use Meshpatch in GH.

It is not in SDK for rhino 5.0 but rhino 6.

So other approach is using RhinoScript.

Then I run into the problem which is how to select multiple ID for the holes.

I wrote this.

private void RunScript(bool reset, Guid OutCrv, Guid Holes, ref object A)

// RhinoApp.RunScript(finalString, true);
RhinoApp.RunScript("_MeshPatch " + "_SelID " + OutCrv.ToString() + "_Enter" + "_SelID " + Holes.ToString() + "_Enter", true);

But the problem is "Holes" iincluding multiple ID.

Which means I should repeat ["_SelID " + Holes.ToString()] many times.

For example, if it is running in Rhino Macro, it is something like this.

0be95faf-dc82-455c-8b89-a97cac166e3e //OutCrv ID
//Holes ID 2
//Holes ID 3
//Holes ID 4
//Holes ID 5
//Holes ID 6
//Holes ID n
So how this work in c#?

Views: 58

Reply to This

Replies to This Discussion


interesting problem, here is a solution:

string message = ""; //or Stringbuilder
message = string.Format("_MeshPatch _SelID {0} _Enter \n", curveID);
for (int i = 0; i < holesID.Count; i++)
 message += string.Format("_SelID {0} \n", holesID[i]);
message += "_Enter";
RhinoApp.RunScript(message, true);



Search Grasshopper


  • Add Photos
  • View All

© 2017   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service