Provide argument to RhinoApp.Runscript()

I want to use RhinoApp.Runscript to execute command.
I have to provide some information , like point , curve etc, to command.
I don`t want to create any object on Rhino,so I want to input these data by RhinoApp.Runscript() or another command executing function.
Is that possible?

You have not provided enough information for us to be helpful. What exactly are you trying to do and why?

I want to use command by RhinoApp.Runscript. The command is created by others.
I want to use command like this.
"_SrfPt 0.0,0.0,0.0 1.0,0.0,0.0 1.0,1.0,0.0 0.0,1.0,0.0"

But input data of this command is complex.
For example, there is a command which needs Face and seeding information on Edge,than surface mesh can be created .
I want to use command by RhinoApp.Runscript without creating real object ,but I don’t know how to do.

If you don’t want to create a document object, then you are not going to be able to use RhinoApp.RunScript. Rather, you will need to use RhinoCommon function to create temporary geometry.

For example, if you just want to make a surface from corner points, you can do this:

import scriptcontext
import Rhino

def SampleSrfPt():
    pt0 = Rhino.Geometry.Point3d(0.0, 0.0, 0.0)
    pt1 = Rhino.Geometry.Point3d(10.0, 0.0, 0.0)
    pt2 = Rhino.Geometry.Point3d(10.0, 10.0, 0.0)
    pt3 = Rhino.Geometry.Point3d(0.0, 10.0, 0.0)
    srf = Rhino.Geometry.NurbsSurface.CreateFromCorners(pt0, pt1, pt2, pt3)
    if srf: 
        # TODO: do something with the 'srf'
        # In this example, lets just add it to the document
        rc = scriptcontext.doc.Objects.AddSurface(srf)
        scriptcontext.doc.Views.Redraw()
    
# Call the function defined above.
if __name__=="__main__":
    SampleSrfPt()
1 Like