Python + Revit API BETA


As the official documentation lacks Python coverage, I thought it would be helpful to include some examples and snippets alongside it.

The code below should work with RevitPythonShell and pyRevit, but can be also be used within Dynamo with minor tweaks.

For a more comprehensive set of examples of Python interacting with the Revit API, check out the pyRevit Repository, Revit Python Shell Git Book, or some of the links in the main page.

Code is hosted on gist.github.com.



Code Snippets


Create Drafting View
Create Text Function
Cycles through Family Types in Family Manager
Get Filled Region Id - by Name
Get Phase By Name
Get Selected Elements
Import Image
Move Room Tag To Room Center
Revit Transaction Decorator
Select All Doors
Set Point Cloud Color Mode

Working Tools


Crop Selected Image Using a Filled Region
Make Floors From Rooms
Move Object to Center of Room
Open Schedule in Excel
Remove Underlay

Online Documentation for the Revit API | Gui Talarico