Here comes the final step of migrating the ADN training material and The Building Coder samples to Revit 2014.
The previous steps included:
Now we turn to the final component, the ADN training material for Revit Structure, consisting of:
The ADN Revit Structure training labs include both a C# and a VB version.
They compile with zero errors right out of the box after updating the Revit API assembly references.
They generate ten warnings each, though, all caused by use of the obsolete Curve.EndPoint property.
In VB, it is represented as an indexed property, whereas the C# version converts it to the Curve.get_EndPoint method instead. This discrepancy is eliminated by the Revit 2014 API method Curve.GetEndPoint, which looks the same in both languages. The advantage of this change is that the C# and VB code becomes virtually identical, whereas previously in C# the properties were converted to methods adorned with a "get_" prefix.
The link sample did not present any unexpected difficulties either.
Again, I cleaned up some calls to the obsolete Curve.EndPoint and Document.Element properties, which have both been replaced by GetEndPoint and GetElement methods.
Please note that the associated AutoCAD .NET add-in requires an additional AutoCAD .NET API reference, accoremgd.dll. The ARX C++ component has not yet been compiled, and we are thinking of replacing it with something else that does not require a full ARX installation to compile.
Unlike the previous RST samples, the NewRstLab code produced a compilation error.
After updating the Revit API assembly references, it generates 25 warnings and one error reporting that the AnalyticalModel class does not contain a definition for the CanSetAnalyticalOffset method used in the RstLab3_3_EditAnalyticalModel command:
// Some structural component's analytical model // can be offset, for instance column. // However some cannot be offset, for instance // beam. So we need to check first if the // analytical model can be offset. if( model.CanSetAnalyticalOffset() ) { // Move the analytical model // one foot along X axis. model.SetOffset( AnalyticalElementSelector.Whole, new XYZ( 1, 0, 0 ) ); }
This method has no direct equivalent in the enhanced offset handling, so I simply replaced it by a try-catch handler for now.
Most of the warnings were generated by calls to get_EndPoint, which again can be trivially replaced by GetEndPoint.
Only 5 compilation warnings remain, caused by the following two obsolete method calls:
Since I could not figure out off-hand how to fix the latter, I left it in for the moment.
Last but not least, we come to the RST AVF and DMU samples, which happily also only generate warnings about usage of the obsolete Curve.EndPoint property, quickly and easily fixed.
Here is adn_rst_2014_0.zip containing version 2014.0.0.0 of the ADN training material for Revit Structure 2014.
There are still a few details to be resolved, and we need to decide internally how to update the pretty trivial column type editing inside of AutoCAD for the RST link demo.
As said, I plan to host all the ADN sample material on GitHub soon, to make is easier to maintain and collaborate on, and also follow Matt's excellent advice to do the same with RevitLookup.