Functions in rhino.command


How can I add a function into:

rhino.Command “-_OrientOnSrf 0 10,0,0 _SelID " & srf & " _Copy=_Yes _Flip=_No _Rigid=_Yes " & ( SOME FUNCTION ) & " _Enter _Enter _Enter”


What kind of function are you trying to put in there? Mathematical to calculate the insertion point?


Hi Mitch,

I would like to loop through an array of points.


OK, that’s easy, basically you need to call the Rhino.Command inside the loop once for each point, in other words, the loop is external to the command. For that you would loop through the points list, convert the current point to a string and then run Rhino.Command - something like :

For Each pt in arrPts
Rhino.Command "-OrientOnSrf 0 10,0,0 SelID " & srf & " Copy=Yes Flip=No Rigid=Yes " & strPt & " Enter Enter _Enter


Thanks Mitch, that is what I do at the moment - but I loose any History.

I was hoping to get the function to loop through and maintain History.