The Level Displacer tool has been available for several years on the App Store. This tool allows you to create an exploded view of your model by automating the process of creating displacement sets for all elements on each level of your model. Each displacement set is translated a user-specified incremented value in the X, Y, and Z directions.
Self-publishing these tools is the quickest and easiest way to get them to you, so you can now get this tool as part of the free Boost Your BIM toolset
If you enjoy using this and the other free tools and educational resources from Boost Your BIM, drop us a line and let us know how you’d like to make Revit better. You can support our work on Patreon too!
Let’s say there is a specific list of View Scales that you want allowed in your Revit projects. Or certain naming conventions that should be used. Or something else like that where you’d like to automate the process of checking a user’s change and determining if it should be allowed, prevented, or trigger a warning.
This can be done with two pieces of Revit API functionality – Updater & Custom Failures. You can find all the code here and an explanation in the video below.
If you think lessons like there are interesting and helpful, please support Boost Your BIM at Patreon, take one of our video courses on the Revit API, or contact us to discuss how we can work together to make Revit better.
Utils.ViewScaleUpdater viewScaleUpdater = new Utils.ViewScaleUpdater(application.ActiveAddInId);
Utils.illegalViewRangeFailureId = new FailureDefinitionId(Guid.NewGuid());
"This view scale is not allowed.");
There are a few things you can’t do with Revit’s “Select All Instances” tool
You can’t select all instance of one type and then all instances of another type and combine them into a single selection set
You can’t select lines
You can’t restrict the selection to all instances in the active view
To solve these limitations, try the new FREE Select By Type tool in the Boost Your BIM Terrific Tools. If you enjoy using this and the other free tools and educational resources from Boost Your BIM, drop us a line and let us know how you’d like to make Revit better and support our work on Patreon.
Here’s a really simple bit of code to create a wall and change the wall type
public void crash()
Document doc = this.ActiveUIDocument.Document;
WallType wt = new FilteredElementCollector(doc)
.FirstOrDefault(q => q.Kind == WallKind.Basic);
using (Transaction t = new Transaction(doc, "test"))
Wall wall = Wall.Create(doc,
The problem is that when you create a wall with the Revit API, Revit uses the wall type last used when a wall was created with the user interface. If the last wall type used was a basic wall, then everything is fine. But if the last wall type used in the interface was a Curtain Wall…
You can work around this by adding a Document.Regenerate() just before changing the wall type. But it is a good reminder to think about how Revit’s state can affect your add-in, be careful working in the API with newly created elements, and that sometimes by adding a “regenerate” or changing how you are using transactions you can find a solution.
Oscar suggested that Revit could have an “action log” that, as an instructor, he could use to find out if students are cheating by “copying the assignment or parts of it from another student”. Here’s a look at how the Revit API solve this problem.
When every element is created, the time and tool used (for example the Wall command, Mirror, Rotate, or Paste…) are secretly and invisibly stored on the element. A user-visible command copies that data into a standard Revit parameter. So if Oscar has all his students run Revit with this tool installed, he can check their work by running the command and seeing how many elements were created with each command.
If this tool or the how-to posts on this site help you do more with Revit, please support Boost Your BIM at Patreon or take our video courses at Udemy so we can make more tools and share more knowledge about how you can make Revit better.
Back in 2016 I granted an API wish during Revit Technology Conference to create lines to visualize the planes of the Plan View Range. Now that tool has been added to the Boost Your BIM Terrific Tool set!
These are two key pieces of Revit API technology that work great together like peanut butter and chocolate
To be honest, RegisterDockablePane + XAML + IExternalEventHandler don’t taste as good as a Reese’s Peanut Butter Cup. But you can use them to create a simple little modeless dialog with a button that creates new drafting views. And from here this basic sample can be a launching pad to all sorts of great Revit tools.
When you pin something there should be an option to write something in a “comments” field. If someone unpins that thing then the comment you wrote would pop up like a warning dialogue. This way they would know why the thing was pinned in the first place.
I’ve created a new free tool that uses the DocumentChanged event and an External Event to prompt the user for a reason when an object is pinned. When the object is unpinned, it shows the username and reason.
Here’s another new tool in the open-source Boost Your BIM Terrific Tools. In the CSV file, enter the existing family names and the new names that you want the families to have. Run the tool and your families are renamed.
M_RPC Beetle,Beetle Car RPC Female,Woman RPC Male,Man Photovoltaic-Panel-SolarWorld-SunModule-(235-240),Solar Panel
Please help Boost Your BIM continue to provide so many free tools and free code samples that help you make Revit better. There’s a lot of great new stuff that Boost Your BIM has coming soon – please visit to https://www.patreon.com/BoostYourBIM to help make these resources possible.
Autodesk made a bunch of changes to the Revit API for Units in 2021. Many frequently-used methods are now marked as obsolete. They still work just fine in 2021 but Autodesk will probably remove them in 2022.
For one example of how to update your code, this old sample computes the total length of all selected objects and shows the result as a formatted string. The new code, which uses the method UnitFormatUtils.Format Method (Units, ForgeTypeId, Double, Boolean) is shown below.
Revit Lookup is a great open-source tool to help you better understand the data in your Revit model. I use it every day, and even if you aren’t writing Revit API code, sometimes it is still useful to get “under the hood” and better understand the data in your Revit model.
You can download the source and build it yourself, but that is not for everyone. So I created an MSI Installer that you can use to install the Lookup tool for Revit 2019, 2020, and 2021. I also submitted some changes to make it easier to build Revit Lookup for any release of Revit. Jeremy wrote a bit about it at The Building Coder.
I built the installer with Advanced Installer, a very powerful and easy to use tool for building your own installations developed by Caphyon. The drag-and-drop interface lets you quickly select the files you want to install and where the installation should place them on the target computer.
Advanced Installer has a freeware version with plenty of capabilities for many Revit API developers. If you want to support them and get even more features there are three different licenses that you can purchase.