I’m trying to get started with scripting Rhino, probably using Python, and I have so many questions. For example:
• What is the difference between Rhino.Python (which has documentation Rhino.Python Guides with Python) and PythonScript (in Rhino’s GUI)? – There seem to be some names that are not helpful. For example, it took me a while to work out that rhinoscriptsyntax does not involve rhinoscript – it mimics it in Python. Why do some commands/methods appear in rhinoscript but not rhinoscriptsyntax?
• When do I want rhinoscriptcontext, scriptcontext or Rhino? Is there a list of the methods associated with each? – I’m starting to suspect that methods accessed via “import Rhino” are in the RhinoCommon API, but how come the documentation RhinoCommon API - Redirect doesn’t provide Python?
• If I find a method or object etc in someone’s script, how do I search for the documentation on it? – do I need to know which API to look in?
You’re welcome to address those questions, but I have more – so really I would like to ask:
• how do I get started here? and
• are there clever ways to search the documentation?
I’m hoping for answers that go beyond Rhino.Python Guides with Python. (I looked there, and searched from there, for insight on “scriptcontext”, for example.)
RhinoCommon is the root API for Rhino. Everything you will ever need will be accessible from here. It is written in C# and a little bit of C++.
Rhino ships a version of Python(ironPython) that is different from the normal Python(cPython). The difference is, IronPython support .NET framework. (In english, All C# API/Classes/methods can be accessed). So, you can use RhinoCommon API (I would suggest that you get used to this, than the other ones).
Theother library is rhinoscriptsyntax which is a wrapper over RhinoCommon. It uses RhinoCommon to simplify certain tasks, and provide them as a package/lilbrary. You can check the rhinoscriptsyntax source files at:
I think you first need to understand the basics of how Python works before trying to use it with Rhino… There are plenty of books/net-based resources out there for that.
After that, here are some more Rhino-related resources: