I hope you are happy and healthy and enjoyed your Easter eggs!
Revit 2021 was released last week with its multi-region cloud model API and numerous other enhancements.
During the holiday, I updated RevitLookup for Revit 2021, and Harry Mattison added his multi-release building enhancements into the main solution as well:
I installed the Revit SDK to read about the new Revit add-in system requirements in the What's New section of the help file:
The Revit 2021 API assemblies are built using .NET 4.8.
At a minimum, add-ins need to target .NET 4.8 for Revit 2021.
Accordingly, I set up the .NET framework 4.8 and developer pack on my system from the Microsoft .NET website:
The developer pack is apparently required from Visual Studio to offer the option of targeting .NET 4.8.
The framework itself has already been installed by Revit 2021:
With the .NET 4.8 developer pack installed, I was ready for the flat migration of RevitLookup to the new version.
I incremented the RevitLookup .NET framework target version and pointed to the new location for the Revit API references.
It compiled right away with zero errors.
The compilation does cause three warnings, though, associated with deprecated enumerations, properties and methods due to the Units API changes documented in the help file:
DisplayUnitType
is obsolete: Please use the ForgeTypeId
class instead. Use constant members of the UnitTypeId
class to replace uses of specific values of this enumeration.UnitUtils.GetValidDisplayUnits(UnitType)
is obsolete: Please use the GetValidUnits(ForgeTypeId)
method instead.Field.UnitType
is obsolete: Please use the GetSpecTypeId()
method instead.We'll take a closer look at these later.
The result of this initial flat migration is available as RevitLookup release 2021.0.0.0.
Harry Mattison of Boost your BIM added support for multi-release building in his subsequent pull request 58 – solution changes for multi-release building:
Create a signed MSI installer using Advanced Installer. Modify the Visual Studio solution to use macro variables to ease the process of building for different Revit versions. All you need to do now is create a new configuration and the output direction, DLL references, and other items will automatically update. It is designed to be very generic and not at all specific to me or anyone else. The
sign.bat
line for signing the installed is commented out with aREM
statement, so it won't affect anyone in its current state. I left it there as a guide for other people to see a nice way to do the signing in a post-build event.
You can read more about the Advanced Installer that Harry used in his own article on RevitLookup install for Revit 2021 and using Advanced Installer for easy MSI generation.
Many thanks to Harry for this useful contribution!
After integrating his changes, all I had to do was set the configuration to Revit 2021.
It had defaulted to 2019, which I do not have installed, so the Revit API assemblies were not found initially.
Once I set the configuration to Revit 20201, it compiled as before, obviously still with the same three warnings listed above.
The current release of RevitLookup including Harry's enhancements is 2021.0.0.2.
I look forward to receiving your pull request to cover new aspects of the new Revit API functionality!
Pandemic influence on relative importance