Revit API

Revit Lookup: must-have for Revit API developers

Revit Lookup lets you inspect “behind-the-scenes” data of Revit projects. You can explore elements, parameters, and properties that are normally hidden. You can also analyze (and understand!) how Revit API works in practice to build and debug your plugins. It really is an invaluable tool for Revit API developers. Revit Lookup is free, open-source, and […]

FilteredElementsCollector: Getting elements with Revit API

FilteredElementCollector allows you to access all kinds of Elements in Revit projects – model elements, families, geometries, views – based on specific criteria. Long chains of FilteredElementCollector methods can be daunting. But don’t worry – breaking them down clarifies a lot. Actually, most cases can be resolved with the image below. 📌 TLDR – Summary

Inserting Families with Revit API

You can insert families programmatically at points, on faces or lines, or create hosted families. Inserting Families is the core of creating Revit Elements – and a must-know for Revit plugin developers.  In this post: code, examples, and everything you need to know about Inserting Families. 📌 TLDR – Summary Upfront: To insert Families programmatically:

Transactions: required to modify Revit projects with API

Your code can’t modify Revit projects without a Transaction. Knowing how to use transactions can save you from frustrating code-breaking errors. In this post: code, examples, and everything you need to know about Transactions. 📌 TLDR – Summary Upfront: Use the Transaction class when your code modifies Revit projects (e.g., create or edit elements). ➡️

Selecting and Picking Elements in Revit API

Selecting elements or geometries in your plugin is possible with the Selection class. 📌 TLDR – Summary Upfront: Use Selection class to: ➡️ Get currently selected elements ​with Selection.GetElementIds(). ➡️ Prompt the user to select elements with various Pick[…] methods (PickObject, PickObjects, PickPoint, …). ➡️ Set selected elements programmatically with Selection.SetElementIds(). The Selection Filter allows you

Buttons in Revit API: PushButton, PulldownButton, SplitButton, RadioButtonGroup

Revit API offers several types of buttons to enhance your plugin’s UI: PushButton (most common), PulldownButton, SplitButton, and RadioButtonGroup. 📌 TLDR – Summary Upfront: ➡️ Use PushButtons for single commands. ➡️ Use PulldownButtons and SplitButtons to group similar commands. ➡️ Use RadioButtonGroups to let users set preferences. Avoid repetitions in command classes: use C# inheritance

Revit Plugin types

Revit API provides three plugin types: Command, Application, and DBApplication. They have various purposes and customization options. 📌 TLDR – Summary Upfront: Revit API has 3 plugin types: ➡️ Command (IExternalCommand): Simplest. Great for testing and single-purpose methods. ➡️ Application (IExternalApplication): The “typical plugin”. Customization of ribbon and buttons. ➡️ DBApplication (IExternalDBApplication): Restricted version of