wiki.ksteinfe.net
Personal tools
 

Rhinoscript:macro development

From ksteinfeWiki

Macros are the most basic way of automating processes in Rhino, and very closely mirror command-line modeling. Working with macros is a bit like recording yourself as you work, playing back every move just as you made it. No information can be stored or recalled, and no calculations may be performed. It’s a bit like training a puppy, he may listen to commands allright, but he’s completely forgotten where he buried that ball. Try copying and pasting the following bit of text into rhino’s command line:

_Line 0,0,0 10,10,0

Now try this more involved macro:

_SelNone
_Polygon _NumSides=6 w0,0,0 w10,0,0
_SelLast
-_Properties _Object _Name RailPolygon _Enter _Enter
_SelNone
_Polygon _NumSides=6 w10,0,0 w12,0,0
_SelLast
_Rotate3D w0,0,0 w10,0,0 90
-_Properties _Object _Name ProfilePolygon _Enter _Enter
_SelNone
-_Sweep1 _SelName RailPolygon _SelName ProfilePolygon _Enter _Simplify=None Enter


Note: The underbars (_) above indicate to Rhino that we are using the English command names, rather than whatever localized language the user has set. The hyphens (-) indicate to Rhino that it should suppress any popup dialog boxes associated with a command. Without this, we would be unable to set parameters of the command within the macro

Note: this example lifted shamelessly from rhinoscript101 by David Rutten