Python gives us the ability to iterate through lists of data, performing functions as we do. In this video, learn one of the ways to achieve this—the for loop.
- [Instructor] While scripting with large lists in Dynamo…we often need to perform a single…function for every item in the list.…Say for example we had a list of numbers,…we may want to create a list of points…based on those numbers driving the x-coordinate.…To do this in Python we need to learn about…a programming concept known as looping.…Looping allows us to execute an instruction repeatedly…until a certain condition is met,…say for example we have looped…through every item in our list.…There are two types of looping in Python,…the for loop and the while loop.…Let's start by looking at the for loop.…
Say for example we have a list of numbers zero to five.…A for loop will allow us to iterate, or loop,…over every item in the list and perform an instruction.…To do this we need a variable, say Var for example,…and for each loop through the list…the item is assigned to the variable Var.…So looping through our list of numbers…in the first loop Var would equal zero.…The second loop Var would equal one and so on.…This will continue until every item…
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 Intermediate
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.