Getting Started with Scripting
Getting started with scripting can be a daunting task for numerous reasons: not knowing exactly where and how best to start, the mountains of documentation available, etc., so below’s an abbreviated approach that should help. Concentrate first on creating simple scripts using the Documentation and Steps to Developing Scripts. Setting up toolbars and toolbar buttons and having scripts load automatically at startup can come later on.
The scripting tool referred to here is RhinoScript accompanying Rhino, the 3D modeling software. An evaluation copy of Rhino can be obtained from the McNeel website (http://rhino3d.com).
Hello World! Steps to Developing Scripts
1) Tools menu: RhinoScript > Edit … (alternatively, Command line: _EditScript)
or use a simple text editor, like Windows Notepad, to create and edit your script;
save with the .rvb file extension (in this case, save as HelloWorld.rvb)
Rhino.MessageBox (“Hello World!”)
End Sub
2) Tools menu: RhinoScript > Load … (alternatively, Command line: _LoadScript)
Load … (select HelloWorld from the list of scripts and press Load)
3 ) Tools menu: RhinoScript > Run … (alternatively, Command line: _RunScript)
Facilitating Script Development / ToolBars
Creating a toolbar with the RhinoScript commands, or adding these buttons to an existing toolbar, will help immeasurably with accessing the script functions during development:
Creating toolbars and toolbar buttons is a creative undertaking all its own. A good place to start is Tools menu: Toolbar Layout > Help and read all the sections related to Toolbar Layout.
Ongoing Use of Scripts
Once a script has been written and debugged it can be loaded automatically when Rhino starts:
then run from a button, HelloWorld for example:
Scripting Documentation
Rhino: Help menu: Plug-ins > RhinoScript > Introduction