From the course: Dynamo for Revit: Python Scripting

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Importing the Revit API

Importing the Revit API

- [Narrator] The Revit nodes in the Dynamo node library provide an easy method to access the Revit project file. But what if we want to interact with Revit in ways that the native Dynamo nodes don't provide, such as, editing crop regions, placing elevations, or other missing Revit commands. To get around this, we can access the Revit API directly from within Python. This will give us access to more classes and methods to use within Dynamo. To understand how to do this, lets first have a look at what an API is. An API, or Application Programming Interface simply provides different methods which one can use to communicate from one piece of software to another. In our case, the Revit API provides us methods in the form of functions and classes, which we can use to send commands to Revit. Revit will understand these through the API, and will return something back to us, like an object or an action. A common way of thinking about the API, is like a waiter in a restaurant. Say we have a…

Contents