How to use input variable when using rhinoapp.runscript?

just for example,I use “circle”,people can creat a circle by rhino.geometry.circle easily.but if I want to create a circle by rhinoapp.runscript is hard to pass the Input variable to command,(i donnot like to click point in viewport,since i use a existing points list component )(the reason I insist to use runscript is there are some command has no corresponding API in RhinoCommond,such as"srfseam")

private void RunScript(Point3d point, double radius, ref object A, ref object B)
{

Rhino.RhinoApp.RunScript("_Circle" + " " + "point" + " " + "radius", true);//failed,donot know to pass the variable
Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(point, radius);//so easy
A = c;
}

thankyou

RhinoApp.RunScript and Grasshopper are not the best of friends. If you really want to add geometry to the 3dm file every time a GH document runs, then I suggest you use proper Rhino.Geometry.Circle constructors and add the result to the document using RhinoDoc.Objects.AddXXXX() methods.

1 Like

Is this about the Surface Seam thing?

thank you David,i have read your code,very helpful!