From the course: Grasshopper and Rhino: Python Scripting
Unlock this course with a free trial
Join today to access over 25,400 courses taught by industry experts.
Rhinoscriptsyntax
From the course: Grasshopper and Rhino: Python Scripting
Rhinoscriptsyntax
- [Instructor] Now that we have an understanding of what dot notation is, let's have a look at how we can use it to create objects using Python. In a new Grasshopper file, let's go ahead and create a new Python component by double-clicking the canvas with the left mouse button, tapping Python, and enter. Then go ahead and open up the Python component by double-clicking it. In an earlier video we discussed this default script but not all in detail. You'll notice on line eight, the words, "import rhinoscriptsyntax as rs." Let's talk about this in a little bit more detail. The keyword, import, allows us to import what we call modules or libraries into our script, to use all the classes, structures and functions from within it. This will then allow us to create objects such as points, curves and spheres. Think of this as a recipe book for creating geometry or objects. Rhinoscriptsyntax is unique in that it contains only functions, not classes or structures. And these functions send…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.