Join Jeremy Graham for an in-depth discussion in this video Nested loops, part of Dynamo for Revit: Python Scripting.
- [Instructor] Now we have a good understanding…of how loops work,…let's take a look at nesting the for loop.…This is basically putting one or more loops…inside of another loop, which becomes useful…when working with nested lists.…As you can see, I've got the Dynamo exercise file…open for this chapter.…Currently, there are a series of rectangles being created…and exploited with the Geometry Exploit node,…which we'll use shortly.…Before we do, let's understand how nested loops work…by creating our own nested list.…Go ahead and place a new Python Script node.…
Let's start by creating a range of numbers…using the range method and we'll assign them…to the list variable, say 10 numbers.…And then let's create an empty list, say output,…and we'll use this to append items to in our for loop.…So next, let's create a for loop…like we have in previous videos with a variable named x…and the range of numbers we've just created.…Within this loop, let's create a point…using this x variable as the x coordinate,…and we'll assign this to the variable p.…
Note: This course uses Dynamo 1.3.1 and Revit 2018. For best results, it helps to have the same versions of the software.
- Importing the Dynamo Geometry library
- Defining variables
- Making decisions with conditionals
- Controlling flow with operators
- Defining functions
- Working with external libraries in Python
- Accessing the Revit API with Python
Skill Level Beginner
1. Dynamo and Python
2. Python Basics
3. Working with Libraries
4. Revit API
Next steps2m 18s
- 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.