Removing Deprecated API Compilation Warnings

I completed The Building Coder sample migration to Revit 2014 back in April, but it was still generating 111 warnings due to use of obsolete API calls.

After migrating the ADN training lab material last week, I thought I could now turn my attention back to resolving these warnings.

I replaced 27 calls to the get_EndPoint method, which actually refers to the EndPoint property, by the new GetEndPoint method.

That reduced the count to 84 warnings.

Replacing the obsolete creation application NewLineBound and NewLineUnbound calls and adding an element id to the argument to all calls to Document.Delete reduced the error list to 48 warnings.

Replacing the calls to NewSketchPlane by SketchPlane.Create reduces it to 24 warnings.

Addressing almost all the rest produced the final result for today with just 5 warnings, three of which are the infamous 'mismatch between the processor architecture of the project being built "MSIL" and the processor architecture' of the referenced Revit API assemblies that I cannot fix myself.

One of the other two refers to a call to the obsolete Document.TitleBlocks, which is intentionally left in to compare with the new approach using the filtered element collector instead.

The second warns about use of the obsolete FindReferencesWithContextByDirection method. It should be converted to use the ReferenceIntersector class instead, which we postpone to some other time.

Here is the result, version 2014.0.100.3 of The Building Coder samples.

Many of the changes have been marked with a trailing comment stating '2013' and '2014', respectively.