Conditionals are used to make decisions in Python based on a true or false result. In this video, learn how to set up IF, ELSE, and ELIF conditions to control decisions within your scripts.
- [Instructor] While scripting in Python,…we often need the script to change when it executes…based on different conditions.…Think of this like a car at a T junction.…It can go either left or right, and in Python,…we often need to tell our scripts to go…either left or right, too.…To do this, we're going to learn…about conditional statements, if, else, and elif.…Before we do, however,…let's have a quick look at the Boolean data type.…Go ahead and start a new Dynamo file,…and let's place a new Python script node.…A Boolean is either one of two states, true or false.…
Think of this like a switch,…the switch is either on, true, or off, false.…To create a Boolean, we simply assign to a variable…true or false, with a capitalized letter.…For example, let's create the variables T and F…and we'll assign to this true and false.…Then let's output both of these at the same time.…Great, so we have true and false.…Most objects have a Boolean state,…meaning we can check if an object is true or false.…
For most cases, an object that is empty, zero, or none,…
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.