How to find the corresponding rhino command in API in Rhinocommon?

For example,in Rhino there is “SrfSeam” command to change the seam of surface,but when I want to write c# component,I cannot find which API is corresponding to “SrfSeam”…who can help me?thank you!

Surface seam is not in Rhinocommon yet.

thankyou Pryor.
then…how to invoke a rhino command in c#,such as “srfseam”?

You could use RhinoApp.RunScript which allows you to run any Rhino command or macro from C#.

PS. no need to start a new topic for the same question, you can edit the original topic title instead.

thank you,i qythium,i understand

It is messy and complicated from within Grasshopper. You must:

  1. Insert the surface into the Rhino document.
  2. Make sure it (and nothing else) is selected.
  3. Compose a command macro to run. It’ll look something like "-_SrfSeam w12.5,3.8,0"
  4. Invoke RhinoApp.RunScript() with your macro.
  5. Find your modified surface object (it should still be the only one selected).
  6. Read in the new surface geometry.
  7. Delete the object.
  8. Possibly restore the selected state from before point [1].
1 Like

srfseam (75.3 KB)

1 Like

Thank you very much David,i have read your code,it is what i want!,but i also want to make the code understand,because i need to code a lot later…the code below:

string macro = string.Format("-_SrfSeam w{0},{1},{2}", P.X, P.Y, P.Z);
I suppose this sentence is for composing the marco,…and what is Format method means?thank you

The curly brackets refer to positional arguments, and get replaced with the string representation of P.X, P.Y and P.Z.

Here’s a graphic showing how it works in Python

(syntax is similar, couldn’t find one for C#)

1 Like

string.Format() allows you to compose strings in a reasonably readable fashion. Instead of typing:

string macro = "-_SrfSeam w" + P.X.ToString() + "," + P.Y.ToString() + "," + P.Z.ToString()

You can use the {0} as placeholders. Search for the string.Format method on msdn and you’ll get a lot of information about patterns and stuff.

thank you!

thank you!!