Functions in rhino.command


(www.cadwax.com) #1

Hello,

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”

thx


#2

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

–Mitch


(www.cadwax.com) #3

Hi Mitch,

I would like to loop through an array of points.

thx


#4

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
strPr=Rhino.Pt2Str(pt)
Rhino.Command "-OrientOnSrf 0 10,0,0 SelID " & srf & " Copy=Yes Flip=No Rigid=Yes " & strPt & " Enter Enter _Enter
Next

–Mitch


(www.cadwax.com) #5

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.