Create lines to show Plan View Range – a new free open-source tool

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!

Download the source code or installer – https://bitbucket.org/BoostYourBIM/boostyourbimterrifictools/src/master/

Support Boost Your BIM so we can make more great free tools – https://patreon.com/boostyourbim

Learn the Revit API so you can make your own great tools – https://boostyourbim.wordpress.com/learn/

Paint Stripper – a new free open-source tool

Inspired by this post on the Revit Ideas forum, here is a new tool that will remove all Paint from your Revit model for one or more materials. Much faster than doing it one at a time!

Download the source code or installer – https://bitbucket.org/BoostYourBIM/boostyourbimterrifictools/src/master/

Support Boost Your BIM so we can make more great free tools – https://patreon.com/boostyourbim

Learn the Revit API so you can make your own great tools – https://boostyourbim.wordpress.com/learn/

Dockable Dialog with External Event

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.

If you like these tools, please support Boost Your BIM so we can make even more of them – take one of our online courses in API programming or support Boost Your BIM at Patreon

Like with all the Boost Your BIM Terrific Tools, you can find the source code & installer at https://bitbucket.org/BoostYourBIM/boostyourbimterrifictools/src/master/

New Free Tool – Pin Comment

From a suggestion on the Autodesk Idea Board:

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.

Like with all the Boost Your BIM Terrific Tools, you can find the source code & installer at https://bitbucket.org/BoostYourBIM/boostyourbimterrifictools/src/master/

If you like these tools, please support Boost Your BIM so we can make even more of them – take one of our online courses in API programming or support Boost Your BIM at Patreon

New free tool – Family Rename

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

New free tool and Open Source initiative – Do Not Print by Category/Subcategory

We are excited to announce a new open-source initiative to make even more great Revit tools available to you and everyone who wants to make Revit better!

The first tool in this project lets you specify categories and sub-categories that should not be printed.

Code: https://bitbucket.org/BoostYourBIM/boostyourbimterrifictools/src/master/BoostYourBIMTerrificTools/PrintSuppression/

Download the Installer here

Please support Boost Your BIM on Patreon

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.

2021 changes Units

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.

https://boostyourbim.wordpress.com/2016/06/21/total-length-of-multiple-lines/
undefined

public void lineLength()
{
    double length = 0;
    Document doc = this.ActiveUIDocument.Document;
    UIDocument uidoc = this.ActiveUIDocument;
    ICollection<ElementId> ids = uidoc.Selection.GetElementIds();
    foreach (ElementId id in ids)
    {
        Element e = doc.GetElement(id);
        Parameter lengthParam = e.get_Parameter(BuiltInParameter.CURVE_ELEM_LENGTH);
        if (lengthParam == null)
            continue;
        length += lengthParam.AsDouble();
    }
    string lengthWithUnits = UnitFormatUtils.Format(doc.GetUnits(), SpecTypeId.Length, length, false);
    TaskDialog.Show("Length", ids.Count + " elements = " + lengthWithUnits);
}

More info on the new Units API is at

Revit Developer Guide documentation
https://help.autodesk.com/view/RVT/2021/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Introduction_Application_and_Document_Units_html

What’s New in 2021 API
https://thebuildingcoder.typepad.com/blog/2020/04/whats-new-in-the-revit-2021-api.html#4.1.3

The best way to upgrade your Revit files

The top-rated upgrade tool in the Autodesk App Store is back for Revit 2021.

Satisfied customers say:

“Our teams with large campus projects no longer groan when it is time for the annual upgrade.”

“There are other solutions floating around in cyberspace but this one is the Holy Grail.”

“I have been using the Bulk File Upgrader for years. The best and easiest add-in to use. I recommend this to anyone who needs to upgrade files.”

“This program is amazing. It works great in all ways that you would expect. “

Features include:

  • Select which file types to upgrade
  • Add suffix to new file names
  • Set “workset open” option (All, Editable, Last Viewed, Specify)
  • Speed the opening process by only opening specified worksets
  • Options to
    • Discard worksets
    • Delete backup folders
    • Relinquish editable worksets
    • Delete backup files
    • Remap RVT Links when saving to a new folder
    • Open files with Audit option

Your purchase helps support all the free API content and training material here at Boost Your BIM.

File Upgrade

Revit Lookup install for Revit 2021 & using Advanced Installer for easy MSI generation

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.

lookup

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.

installer

 

Innovate & Improve by Learning The Revit API

“We see this an opportunity to find new ways to innovate, improve our process and keep this economy moving.” – Wendy Rogers, LPA, Chief Executive Officer

Boost Your BIM and LPA have worked together on great projects to improve their Revit processes, and Wendy is right that we all should keep innovating while staying healthy and safe.

Hundreds of people have gained valuable skills through the Boost Your BIM Revit API video course. You save $ and I make more $ if you use the links below:

(Udemy is making these coupons expire each month, so the links will be updated as needed)

review 3review2review1

part1

part2

materials

 

 

Revit Lookup for Revit 2020

Revit Lookup is a great (and free) tool to learn more about what’s in your Revit models. If you want to look at source code, deal with GitHub, and learn more about it, go to https://github.com/jeremytammik/RevitLookup

If you just want to install it for Revit 2017-2020, go to https://drive.google.com/open?id=1lnhx9ngyTZHi-hMMby-4a5K8NyWIFtV5

Get total length of multiple lines & units conversion

This post on the Revit Ideas forum inspired a new lecture on the Boost Your BIM Revit API course at Udemy. It is a great example of how just a few lines of code (17, to be exact) can be written in just a few minutes to do something useful.

Override Dimension Text (part 2)

Building on our last post, here is the finished tool with UI that allows you to modify the dimension text on a single or multi-segment dimension by selecting the dimension, not the dimension text.

FREE Installer: https://drive.google.com/open?id=16_oZYpfXjXcSaYe_IOv-K0ivR4ebsMLr

add additional way to get to Dimension Text dialog (to edit Dimension’s text)

In the Revit Ideas forum it was asked if it can be possible to access this dialog to change dimension text without having to select the dimension’s text itself. Either the text has been overridden with an invisible, empty character, a view break was used, or for some other reason it isn’t simple to select the dimension’s text. Or you want to avoid the problem of moving the dimension text by mistake when you try to click it.

Fortunately, the API gives you access to most everything in this dialog (maybe not “show label in view” and “segment dimension leader visibility”). The code is below to handle a dimension with a single segment (code for the Dialog form is not included) and it could also be enhanced to work with a multi-segment dimension if the form listed the text of each dimension segment so you could specify which segment to modify.

Is there interest in a Udemy lecture showing how to code the form? Or posting it as an app in the Autodesk store?

public void dimText()
{
    Document doc = this.ActiveUIDocument.Document;
    UIDocument uidoc = this.ActiveUIDocument;
    Dimension dim = doc.GetElement(uidoc.Selection.PickObject(ObjectType.Element, "Select dimension")) as Dimension;
    if (dim.NumberOfSegments > 1)
    {
        TaskDialog.Show("Error", "Can only run when the dimension has a single segment");
        return;
    }
    
    string above = "";
    string below = "";
    string prefix = "";
    string suffix = "";
    string replaceWithText = "";
    
    using (FormDimText form = new FormDimText(dim))
    {
        form.ShowDialog();
        if (form.DialogResult == System.Windows.Forms.DialogResult.Cancel)
            return;
        above = form.getAbove();
        below = form.getBelow();
        prefix = form.getPrefix();
        suffix = form.getSuffix();
        replaceWithText = form.getReplace();
    }
    
    using (Transaction t = new Transaction(doc, "Dim Text"))
    {
        t.Start();

        dim.Above = above;
        dim.Below = below;
        if (replaceWithText == null)
        {
            dim.Prefix = prefix;
            dim.Suffix = suffix;    
        }
        else
        {
            dim.ValueOverride = replaceWithText;
        }

        t.Commit();
    }
}

New Revit API online course – Materials

Want to learn more about the Revit API for Materials? This is one of the areas where Autodesk has done a lot of great work over the past few years making much more functionality accessible to the API developer. But some of it can be tricky to figure out. So don’t waste time struggling with it, take this new course instead to quickly get up to speed.

Here are a few recent reviews from the Boost Your BIM introductory course on the Revit API:

“great way to learn a lot about how to program the Revit API”

“just exactly what I need to scale up”

“Great course, well structured, good ongoing updates for changes in versions”

If there are any material related topics that you don’t see listed in the curriculum, leave a comment so we can consider adding more lectures about what you want to learn.

Image-O-Matic is back! And Free!

Animate your Revit model by changing family parameters, displacement set offsets, or phases. Use it to test your family content by varying parameter values or to wow your colleagues with amazing animations. This popular tool now supports Revit 2019. You can download it from the Autodesk App Store here