When working with nested data input from Grasshopper or created in Python, it needs to be iterated over carefully to use the different layers. In this video, learn how to access nested data by creating nested loops.
- Now that we have a good grip on how loops work,…let's take a look at nesting loops.…This is basically adding one or more loops inside…of another loop, which becomes useful when working…with nested lists or data trees.…I've simply gone ahead and created a range node…to create a range of numbers zero through to nine,…so let's go ahead and add a Python component,…and remove the y input, and we'll change x to numbers.…
Which will be a list.…And we want to operate on integers.…Then go ahead and plug the range of numbers…into the numbers input, and double-click…to open up the Python component.…The first thing we need to do is replace the…rhino script syntax import with rhino dot geometry as rg.…As we'll be creating points and lines later on.…To understand how nested loops work, let's create our…own nested loop within Python.…
Start by creating an empty list,…which will append points to in the for loop.…I'm gonna call mine points.…Next, let's create a for loop,…like we did in previous videos.…With a variable named x, looping…
- 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.