From the course: Dynamo for Revit: Python Scripting
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Working with lists
From the course: Dynamo for Revit: Python Scripting
Working with lists
- [Instructor] If you've worked much with in Dynamo, you're probably more than experienced at using lists to store numbers, geometry or Revit elements. A list is used to sort objects in an ordered manner. In Dynamo, all data outputting from nodes that is more than one item is essentially a list. So, let's have a look at some of the fundamentals of using lists in Python. In a new Dynamo file, let's go ahead and place a new Python script node and then open that up. Creating a list can be done in a few different ways. The simplest method is using square brackets to create an empty list. For example, let's create a variable name LST and we'll assign to this an open and closed square bracket, and then output LST. As you can see, we're outputting an empty list. We can also create a list with pre-defined items. For example, let's create a new list variable and we'll name it LST Nums and this time, inside of the square brackets, we'll add the numbers zero to four, separated by commas. The…
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.
Contents
-
-
-
-
Defining variables6m 26s
-
(Locked)
Numbers7m 40s
-
(Locked)
Strings7m 11s
-
(Locked)
Working with lists6m 22s
-
(Locked)
Making decisions with conditionals7m 48s
-
(Locked)
Control with operators5m 46s
-
(Locked)
Logical operators7m 14s
-
(Locked)
Looping with the for loop5m 17s
-
(Locked)
Looping with the while loop6m 22s
-
(Locked)
Break and continue3m 15s
-
(Locked)
Nested loops6m 20s
-
(Locked)
Dictionaries4m 42s
-
(Locked)
Try and except3m 55s
-
(Locked)
Defining functions6m 7s
-
-
-
-