RhinoScript vs. Python?

Hey guys, total noob to scripting here.
I want to start getting my feet wet, and was hoping for some advice on which path to follow - RhinoScript vs. Python.
I understand that Python has use across many applications, but RhinoScript is native to Rhino (obviously).
Can anyone enlighten me as to the best path to choose? Or will I end up learning both?

Thanks guys,

Aaron

(VB) Rhinoscript is not “native” to Rhino, it’s an add-in like many other things. In some aspects, working with the vb version is somewhat more tightly integrated - I think there’s one less layer to go through - but in the end Python + rhinoscriptsyntax has a lot more advantages, including cross-platform capability and access to very powerful lower-level RhinoCommon methods. The rhinoscript methods are very similar between vb and python, they generally accept the same arguments in the same order and return the same results, so if you learn one, you have essentially learned the other as well. The difference will be in the rest of the programming structure around Rhinoscript - for me anyway, it’s no contest - Python wins every time, its far more powerful, flexible and IMO easier to use.

–Mitch

I prefer Python as well, however, I think that Rhinoscript was better supported by McNeel. There are still about 100 Rhinoscript methods that were never implemented as Python methods. Some don’t make sense to implement and others have work-arounds.

I’ll give you one example. We use madCAM, and I have a script that sets tolerances in the file using a few of the RenderMesh methods. This is a script that I can’t do in Python because the RenderMesh methods were never implemented. Yes, I could use command strings using -DocumentProperties, and eventually when I’ve given up hope that the Python implementation will be complete, this is probably what I’ll do, but in the meantime, there doesn’t seem like an issue having Python and RS scripts utilized concurrently.

Dan

1 Like

Hi Aaron,

Before anything else: What do you want to do?
Or better: Why do you want to start scripting?

My advice to any ‘noob’ would be to go for RhinoPython.
Mitch already outlined how much more powerful python is compared to Rhinoscript, I can only side with him on that.

However, as Dan points out maybe there are specific requirements you have in mind that (on the short term) would tip the scales to Rhinoscript.

In any case you have already found a good place to get feedback on scripting for Rhino, be it Python or VBS
Do not hesitate to post your questions here, particularly ‘noob’ questions and issues can be of great value to anyone visiting here. Remember there are no stupid questions, just stupid answers.

-Willem

Hey Dan,

We’ve been busy with other tasks but implementing the missing functions is important for us. Like you say, not all of them make sense so we’ll implement them based on the demand. I see you asked for the RenderMesh functions in the past but said they were low priority. I’ve added them to the list and plan to get to them as soon as I can.

Alain

Add getpolyline too while your at it please :wink:

Hi Alain,

Not having these methods is not a show stopper for us. The Rhinoscript version is working well. However, it’s one of the few scripts that I couldn’t rework in Python. I think the CompareGeometry is the other method that I’m hoping to see implemented some day.

Thanks,

Dan

@Aaron_Clark python by far. It is much more pleasant to write code in python. If you’re totally new to programming, I can recommend you to read and study “learing Python the hard way” (google it) It’s a good start to learn the language and programming in general. And of course the excellent Python primer 101.

Gijs has a good point. Python is used in a lot of different places so there will be a lot more general information, samples, lessons, and books on this scripting language.

Thanks so much for the overwhelming response guys, it looks like I’ve definitely come to the right place!
I’ve printed of the Python for Rhino 101 primer - a little bit of light reading there for me.

Thanks @Gijs for recommending “learing Python the hard way” - a somewhat daunting title, but that’s never stopped me before.
And @Willem, there are definitely stupid questions, as I’m sure you’ll all find out :slight_smile:

Ta,

Aaron

I’ll add both CompareGeometry and GetPolyline as soon as I can.

1 Like

Another vote for Python here. In addition to all the other comments about resources, etc., it’s a good time to learn. Python has become more popular in the Rhino/Grasshopper community (it’s included in Rhino 5 for both Windows and Mac, it’s popular among Grasshopper coders, etc.). And if you are a Grasshopper user, it will be a default scripting component in GH2. Plus there’s talk users will have the ability to compile scripts into GHAs.

On a side note, @andheum wrote a nice FAQ piece on the Grasshopper forum addressing the pros and cons of the three primary scripting langues in GH—C#, VB.Net, and Python—if you’re interested.

Happy coding!