Python? or Visual Basic?


#1

Hi Rhino! :grin:

I am interested in creating a Rhino script.
Which Programming Language Should I (a complete beginner) learn First? :sweat_smile:


#2

I would say Python


#3

Python will be a tiny bit harder to learn at first, but will be worth the effort as it gives you access to many more advanced functions (via Rhinocommon) that vb rhinoscript does not.

The other thing I should say here is that learning scripting is two things at once - learning various methods and strategies in programming which are common to all languages, plus learning the syntax of the particular language you are interested in. Once you have mastered the principles of the first part, switching languages is not nearly as hard.

–Mitch


#4

I 'm very grateful to you for all your help! :heart_eyes:


(qythium) #5

+1 vote for Python too :slight_smile:

For a beginner level I’d say it’s mostly personal preference - both are weakly typed and with similar styles of library functions through the rhinoscript wrappers. But once you start doing more complex operations, Python is definitely more expressive and comes with more modules you can easily import and use.

(To confuse things, VB.NET which you can use in Grasshopper is a completely different language from VBScript)

You can look through samples for both languages here and decide which looks friendlier :

Python:

http://developer.rhino3d.com/api/RhinoScriptSyntax/

VBScript

http://developer.rhino3d.com/api/rhinoscript/index.html

Two big differences in syntax are the case sensitivity (Python’s approach is more standard among other languages, but may take a bit of getting used to) and indentation (Number of spaces at the start of a line is meaningful in Python but completely ignored in VBScript)


#6

Thank you so much. :grinning:


(Willem Derks) #7

I also advice you go for Python.

Begin here : http://developer.rhino3d.com/guides/rhinopython/primer-101/

notice there is also a PDF document for the primet-101:
http://download.rhino3d.com/IronPython/5.0/RhinoPython101/

Any questions do post them at the scripting section of discource:
https://discourse.mcneel.com/c/scripting
don’t hesitate to ask it’s a great community that is eager to help!

Good luck!
-Willem


#8

Yeh! :sunglasses:
Thank you.