From the course: Dynamo for Revit: Python Scripting

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Working with lists

Working with lists

From the course: Dynamo for Revit: Python Scripting

Start my 1-month free trial

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…

Contents