Saving libraries of classes and functions we create, allows us to reuse code for later projects. In this video, learn how to save our work to Python files to which we can reimport into Grasshopper.
- [Instructor] Importing different libraries and modules…is a great way to extend the functionality of Grasshopper…and get more out of our workflows.…Another benefit of Python is that it allows us to create,…store, and reuse our own functions…by saving and importing our own Python modules.…In this last exercise, we used a Python component…to break up a list of points into different branches…to create a data tree.…Let's try adapting this component into a function,…which we can then import into other Python components…in separate Grasshopper files.…
To make this a little bit more useful though,…let's change the script to break up a list into paths…based on a slider input.…To do that, let's double-click the left mouse button…on the canvas and write 20 to create a slider.…Then on our Python component let's add an input.…We'll call this breakP, and we'll change this…to type int and input our slider.…Then double-click the component to open it up.…
So to adapt our script as we left it off,…all we need to do is update line 19,…
- Python components
- Accessing the Rhino API
- Python programming basics
- Importing modules and libraries
- Grasshopper workflows
- Evaluating surfaces
- Creating and splitting surfaces
- Transforming geometry
- Baking geometry from Python into Rhino
- Adding text objects
- Exporting rendered frames for animation
Skill Level Intermediate
1. Working with Python
2. Python Basics
3. Importing Modules and Libraries
4. Grasshopper Workflows
Next steps3m 53s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.