I finally tackled the task of migrating The Building Coder Samples to Revit 2016.
I also have another update on RevitLookup to report:
- Fixing the compilation errors
- Installing RvtSamples
- RevitLookup update displays all built-in parameter names
Before doing anything else, I ensured that the entire project compiles for Revit 2015 with zero warnings.
This guarantees that I am not using any API functionality that was already deprecated in Revit 2015 and therefore removed in 2016.
I then replaced the Revit 2015 API references by the Revit 2016 ones:
After that, compilation produced 6 errors and 30 warnings.
Fixing the Compilation Errors
The six errors all have the error number CS0246 and are caused by two simple issues:
- The type or namespace name 'ExternalDefinitonCreationOptions' could not be found
- The type or namespace name 'ContFooting' could not be found
The first of these is due to a typo fixed in the Revit 2016 API, a missing 'i' in the spelling of the class name, which is now named ExternalDefinitionCreationOptions, as originally intended.
The second missing class is renamed to WallFoundation in Revit 2016, cf. Structural API changes > ContFooting and ContFootingType class and members renamed.
These errors are fixed by renaming ExternalDefinitonCreationOptions to ExternalDefinitionCreationOptions and ContFooting to WallFoundation. The errors are eliminates and 30 warnings remain.
We completed the first successful compilation of The Building Coder samples for Revit 2016!
I published that right away as release 2016.0.120.0.
Before starting to fix the warnings, I thought it might be nice to give it a test run.
To do so, I would like to use the RvtSamples external application add-in to load it.
That is included in the Revit SDK samples and can be compiled together with all the other SDK samples using the Visual Studio solution SDKSamples.sln:
I downloaded the Revit SDK installer dated April 23 from the Revit Developer Centre and was able to compile with no problems.
The next step is to set up RvtSamples to load all the SDK samples into Revit.
I edited RvtSamples.txt, replaced the default SDK samples path
C:\Revit 2016 SDK\Samples\ by my specific location, and toggled the
Release binary directories to
Some paths are still erroneous, e.g.
- C:\a\lib\revit\2016\SDK\Samples\DatumsModification \CS\bin\Debug\DatumsModification.dll
On my system, it needs to be changed to
- C:\a\lib\revit\2016\SDK\Samples\DatumsModification \DatumsModification.dll
With that, RvtSamples loaded successfully and provides access to launch most of the other SDK external command samples:
I added the include directive that I implemented back in 2008 to pull in the BcSamples.txt file to load The Building Coder Samples to the end of RvtSamples.txt:
Lo and behold, now The Building Coder samples are accessible from the RvtSamples collection as well:
I'll return and fix those pesky warnings some other day.
RevitLookup Update Displays All Built-In Parameter Names
Maxence Delannoy @mdelanno submitted a new pull request #9 on RevitLookup to list all the display names associated with a given built-in parameter:
The new version is tagged as RevitLookup release 2016.0.0.9.
Thank you very much, Maxence!