Revit 2020.1 was released a month ago.
Harlan Brumm provides an overview of the new features in his article on What’s New in Revit 2020.1.
An updated Revit SDK for it has now been published in the Revit Developer Center.
I just recently created the RevitSdkSamples GitHub repository for the Revit SDK samples, to support the sample code text search in Gui Talarico's apidocs.co online .NET API documentation.
Thanks to that, you can accompany me step by step as I install and adapt the SDK update for my system.
Before getting to that, however, let's look at what's new in the Revit 2020.1 API:
The new class:
represents an HVAC analytical system element where the air or water is circulated to satisfy building energy requirements. Its AnalyticalSystemDomain property indicates whether the element represents a water loop or air system.
The new class:
contains the data for a water loop system. It can be obtained from the MEPAnalyticalSystem.GetWaterLoopData() method. It offers the following properties:
The new class:
contains the data for an air system. It can be obtained from the MEPAnalyticalSystem.GetAirSystemData() method. It offers the following properties:
The new class:
represents a zone equipment element used for Mechanical Systems Analysis. Zone equipment is an early-stage equipment placeholder that provides heating or cooling to part of the air system or water loop. One zone equipment element may be mapped to multiple pieces of physical equipment depending on the zoning behavior type.
Analytical spaces may be associated to one or more zone equipment elements. The method:
moves a set of spaces from the original zone equipment to the targeted zone equipment. Either zone equipment id may be InvalidElementId. If the original is InvalidElementId, the association is copied to the target zone equipment. If the target is InvalidElementId, the original association is removed. The method:
returns the set of zone equipment that is associated with the specified analytical space or spaces.
The new class:
represents the data associated with a zone equipment. It can be obtained from the ZoneEquipment.GetZoneEquipmentData() method. It offers the following properties:
A system zone in Revit is used to specify what parts of a building are served by specific equipment, air systems and water loops, without having to physically model them. In the Revit API, a system-zone is represented as a GenericZone element with a domain data of type SystemZoneData.
The new class:
provides for a method of selecting elements that somehow come in contact with the zone object. A zone is a non-hierarchical structure of geometric information, area or volume definitions for the purpose of analysis. A generic zone will contain specific domain requirements provided at creation of the element. In Revit 2020.1, all GenericZones will represent system-zone elements used for MEP design. Some relevant new members of GenericZones include:
For system-zone elements, the domain data will be an instance of the new class:
This data includes a reference to the zone equipment for the spaces in this system-zone:
The new class:
represents a view instance of the systems analysis report. In a typical API workflow, to run a systems analysis against a Revit project, create (via ViewSystemsAnalysisReport.Create()) a new view instance and request (via ViewSystemsAnalysisReport.RequestSystemsAnalysis()) the systems analysis from that view. The analysis will run in the background, and when the analysis is completed, the related views are automatically updated. The method RequestSystemsAnalysis.IsAnalysisCompleted indicates if the background systems analysis has completed or not.
It is possible for a project to contain multiple systems analysis reports. The method:
returns the latest report of systems analysis. The peak heating/cooling loads of all EnergyAnalysisSpace elements should be consistent with this latest report.
The new class:
contains some properties (e.g., WeatherFile, WorkflowFile, and OutputFolder) that affect the systems analysis. It is okay to leave some parameters empty. In those cases, the analysis will take the default value from the ViewSystemsAnalysisReport element. The weather file affects the results of energy simulation. The systems analysis will use the weather file at the current site location if SystemsAnalysisOptions.WeatherFile is empty.
Three new Application methods allow access to name and path information for systems analysis workflows:
The new property:
should be set to true to export the analytical system related items when exporting to gbXML.
The Revit API now allows customization to create "custom temporary view modes" applied to a view as a temporary view property.
For this release, the "Reveal Obstacles for Path of Travel" temporary mode is implemented this way. It uses the Analysis Visualization Framework (AVF) to display additional graphics on top of the view contents.
The new properties:
provide access to read and modify a custom temporary view mode. CustomTitle should be set to cause the view to display the customized frame. The application is responsible to adjust the appearance of elements in the view related to the mode.
The new property:
provides access to read or set if a given schedule is using a striped row display.
The Reveal Obstacles view mode highlights elements in the plan view when those elements will act as obstacles for the current Path of Travel calculation settings. The new methods:
PathOfTravel.IsInRevealObstaclesMode()
PathOfTravel.SetRevealObstaclesMode()
provide access to read or set if a view is displaying this mode.
The new class:
provides access to color settings which affect the colors applied to specific views.
The ColorOptions for the current session of Revit can be accessed via:
It has the following properties:
Several new RebarConstraint methods allow control over distances and spacing:
Two new methods have been added to RebarConstraintsManager:
these methods return all possible RebarConstraints that could be used for a RebarConstrainedHandle related to the additional input. For free form rebar these will return an empty list.
The initial state after installing the SDK is captured in RevitSdkSamples release 2020.1.0.0.
Next, I opened SDKSamples.sln
in Visual Studio and rebuilt all.
That generated 5 errors and 38 warnings, because some projects were lacking documentation comments on certain methods, generating a warning, triggering an error.
Turning off the XML documentation file toggle for the RebarFreeForm and SampleCommandsSteelElements projects improved things and reduced the count to 1 error and 39 warnings.
I set up the missing reference to Massing/PointCurveCreation/CS/Microsoft.Office.Interop.Excel.dll, reducing the error count to zero.
Most of the remaining 37 warnings are caused by the architecture mismatch and can be fixed by one single call
to run DisableMismatchWarning.exe
recursively in
the main Samples
folder.
Zero errors and five warnings remained.
I turned off XML documentation file toggle for AppearanceAssetEditing project, reducing them to zero errors and four warnings.
This state is captured in in RevitSdkSamples release 2020.1.0.1.
A more daunting task is setting up RvtSamples to load all the external commands implemented by the SDK samples.
This mainly involves editing RvtSamples.txt
and setting correct paths to the sample DLLs.
Some of the VB.NET samples place their DLLs in the bin
directory, not in bin/Debug
.
Furthermore, the DatumsModification sample does not implement an external command named Command
, as specified in the original version of RvtSamples.txt.
Instead, it implements three, named DatumStyleModification, DatumAlignment and DatumPropagation.
After fixing those issues, all samples listed in RvtSamples.txt load successfully.
This state is captured in in RevitSdkSamples release 2020.1.0.2.
I hope this saves you some time setting things up yourself.
For other examples of setting up RvtSamples, please refer to similar descriptions for previous releases.