Well what you’re doing (it appears) is running a method that lets you pass Rhino a command macro, and no those don’t let you simply pass GUIDs, unless you add SelID (I think?) to your string to actually pick by ID.
It’s just a selection command that allows you to enter an object ID (GUID) and if that ID is found in the document and the object is selectable, it will be selected. There’s not much more information than that…
Thank you Mitch
Does this mean that with rs.Command I could sort of simulate any Rhino command, even those that are not available among Rhinoscript methods?
For example there is no rs.AddArcBlend method.
But could I just “call” the ArcBlend command from Rhino using the rs.Command:
import rhinoscriptsyntax as rs
c1 = rs.GetObject("pick up the first curve",4)
c2 = rs.GetObject("pick up the second curve",4)
rs.Command("-ArcBlend " + "SelID " + str(c1) + " SelID " + str(c2) + " ")
Most but not all… There are some commands that rely on screen picks that cannot be easily scripted - if at all. For example AcrBlend relies on which end of the curve you pick on-screen. If you run your script as is, it will connect the two curve start points by default. You can work around this by using GetCurveObject, collecting where the pick points are and flipping the curves if necessary before calling rs.Command.
On the other hand there are some commands that can ONLY be scripted using rs.Command - notably Open, Save/As, Import and Export…
import rhinoscriptsyntax as rs
def CheckFlipCrv(crv,param):
dom = rs.CurveDomain(crv)
if abs(dom[1]-param) < abs(param-dom[0]):
rs.ReverseCurve(crv)
c1 = rs.GetCurveObject("pick the first curve near end to blend",4)
CheckFlipCrv(c1[0],c1[4])
c2 = rs.GetCurveObject("pick the second curve near end to blend",4)
CheckFlipCrv(c2[0],c2[4])
rs.Command("-ArcBlend " + "SelID " + str(c1[0]) + " SelID " + str(c2[0]) + " _Enter")
I would always use " _Enter" where you specifically want to simulate the user pressing the enter key to terminate the command.
As far as setting options within the command string, Rhino is somewhat inconsistent in this regard, sometimes you need to script options with an equals, as in "...value=n..." and sometimes you need to use a space as in "...value n...". Only way to know for sure is to test.