Looks like you’re mixing some vbscript and python…
The following should work - you may need to change the direction to V if desired. I removed any error checking, you will need to flesh out the script somewhat.
import rhinoscriptsyntax as rs
obj = rs.GetObject("Pick a surface to add knot",filter=8,preselect=True,select=True)
pt = rs.GetPointOnSurface(obj)
rs.Command("_-InsertKnot Direction=U "+str(pt))
Think you Helvetosaur:
It work good.
By the way, I want ask if I don’t use the function “rs.GetPointOnSurface”, I want insert Knot to surface by the parameter of U V I have already set.
For example:
import rhinoscriptsyntax as rs
obj = rs.GetObject("Pick a surface to add knot",filter=8,preselect=True,select=True)
U = rs.SurfaceDomain(obj, 0)
V = rs.SurfaceDomain(obj, 1)
pt = [(V[0]+V[1])*0.1, (U[0]+U[1])*0.1]
rs.Command("_-InsertKnot _D=B " + str(pt) + " _Enter")
It worksd, but have not Knot add.
Sorry for my English skill.