One advantage of using the Python script node is that the Revit API can be accessed directly. In order to work with the Revit API, multiple libraries need to be imported to access the Revit document, transaction manager, and Revit elements. In this video, Jeremy explains what these imports are and why they are needed to work with the Revit API in Python. In doing so, Jeremy explains what an API or application programming interface is.
- [Instructor] To work with and edit the Revit document…that Dynamo is operating in, we need to understand…what the document manager and…transaction manager classes are,…both of which are found in the Revit API.…The document manager class allows us to access…the document within the Revit project file…that Dynamo is working in.…The document object represents the open Revit project file…and therefore stores access to all the Revit elements…as well as managing all the Revit data and views.…The transaction manager class is required to make changes…inside the Revit document.…
So for example, if we want to move a family…or create a wall, we first need to start a transaction,…make the model change, and then end the transaction.…All the changes we make are committed to the model…once the transaction ends.…If we try to edit the model outside of a transaction,…this will cause an error, as Revit will refuse the request.…I currently have the Dynamo and Revit exercise files…open for this video.…In the Python script node, this is where we left off…
Author
Released
12/14/2018Note: This course uses Dynamo 2.0.1 and Revit 2019. For best results, it helps to have the same versions of the software.
- Importing the Dynamo Geometry library
- Python basics: variables, conditionals, operators, loops, and functions
- Using and extending Python modules
- Accessing the Revit API with Python
- Revit and Dynamo conversions
- Creating a collector in the Revit API
- Getting Revit parameters with the Revit API
- Adjusting elements with the Revit API
- Creating views with the Revit API
Skill Level Intermediate
Duration
Views
Related Courses
-
Dynamo: Practical
with Paul F. Aubin2h 51m Intermediate -
Grasshopper and Rhino: Python Scripting
with Jeremy Graham5h 12m Intermediate -
Dynamo Essential Training
with Ian Siegel3h 9m Appropriate for all -
Dynamo for Revit Project Setup
with Ian Siegel1h 35m Intermediate -
Learning Python
with Joe Marini2h 11m Beginner
-
Introduction
-
What you should know1m 31s
-
Exercise files1m 2s
-
1. Dynamo and Python
-
The Python node basics5m 5s
-
What is OOP?5m 58s
-
Importing the Dynamo library4m 31s
-
-
2. Python Basics
-
Defining variables6m 26s
-
Numbers7m 40s
-
Strings7m 11s
-
Working with lists6m 22s
-
Control with operators5m 46s
-
Logical operators7m 14s
-
Looping with the for loop5m 17s
-
Looping with the while loop6m 22s
-
Break and continue3m 15s
-
Nested loops6m 20s
-
Dictionaries6m 37s
-
Try and except3m 55s
-
Defining functions6m 7s
-
-
3. Working with Libraries
-
Built-in Python modules6m 58s
-
Extending Python modules4m 28s
-
Saving our own module5m 6s
-
Accessing Revit nodes6m 18s
-
Importing the Revit API3m 12s
-
Working with the Revit API7m 46s
-
Revit conversions5m 53s
-
Dynamo conversions6m 57s
-
Navigating the Revit API5m 49s
-
-
4. Revit API
-
Collecting elements3m 22s
-
Creating a collector7m 14s
-
Getting Revit parameters5m 51s
-
Setting Revit parameters6m 24s
-
Element locations3m 25s
-
Adjusting elements5m 13s
-
Creating a view4m 6s
-
View bounding boxes6m 23s
-
-
Conclusion
-
Next steps2m 34s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Working with the Revit API