Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Revit API Compatibility Across Versions

TerryDotson
Mentor Mentor
2,422 Views
2 Replies
Message 1 of 3

Revit API Compatibility Across Versions

TerryDotson
Mentor
Mentor

We have been developing add-ons for AutoCAD for 20+ years and are thinking about testing the water in Revit (mainly the Arch version).

 

If a .NET based plugin is produced for a given version, will it typically work in future releases?

 

Is there a good reason to back up and support older versions (example we were considering a 2011 install).  Or is the vast majority of Revit users on subscription and likely to have the latest version?

 

Any tips or recommendations (for a developer experienced with AutoCAD) would be appreciated.

0 Likes
Accepted solutions (1)
2,423 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Terry,

 

Thank you for your query.

 

I am sorry to say that the answer to your first and main question is simply no.

 

Generally, a Revit add-in requires recompiling for a new major release of Revit.

 

Say you have implemented and installed your add-in for and on Revit A, and the user updates to a new major release Revit B.

 

Due to the fact that the .NET framework isolates the add-in from the underlying API to a certain extent, all the functionality in the Revit B API that remains unchanged from Revit A will continue working.

 

However, unlike AutoCAD, Revit does not maintain backwards API compatibility.

 

For instance, access to the endpoints of a curve element used to be via the indexed EndPoint property, taking an argument 0 for the start and 1 for the end endpoint.

 

In C#, this property was automatically translated to a method get_EndPoint, whereas in Visual Basic, it remained unchanged, an indexed property EndPpint.

 

In Revit 2014, this property was declared deprecated and replaced by a new method GetEndPoint which is and remains a method under all circumstances and in all languages.

 

In the next major release of Revit, the deprecated method will be declared obsolete and removed.

 

From that moment onward, a Revit 2012 add-in trying to access the EndPoint property (or get_EndPoint method in C#) will cease working.

 

So Revit provides much less backwards API compatibility than AutoCAD.

 

Users are encouraged to update in a more timely fashion.

 

One important tip for AuoCAD developers is to try to let go of the expectations that working with Auto CAD APIs has fostered ... Revit is a different animal and the experience and expectations coming from any other CAD system can be just as much a hindrance as an asset:

 

http://thebuildingcoder.typepad.com/blog/2012/02/bim-versus-free-geometry-and-product-training.html

 

http://thebuildingcoder.typepad.com/blog/2012/10/porting-an-autocad-application.html

 

On the other hand, the Revit API is much smaller and simpler than AutoCAD's. An experienced programmer should be able to get going within a few hours, and understand everything there is to know within a few days, which is definitely not possible in AutoCAD.

 

One last thing: in Revit add-in development, it is more important than in AutoCAD to have a good product and user workflow understanding before beginning to think about any application development, both because the workflows in real BIM projects are more complex, and because the API more closely mimics and supports the user interface functionality. As always, it is important to go with the flow, and not fight against it.

 

I hope this helps.

 

Good luck getting into the Revit API.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 3

jeremytammik
Autodesk
Autodesk

Oh yes, one more thing: an example of setting up a Visual Studio project to target multiple versions of Revit simultaneously.

 

Actually, even more: a Visual Studio add-in wizard to automatically do it for you:

 

http://thebuildingcoder.typepad.com/blog/2013/11/multi-version-visual-studio-revit-add-in-wizard.htm...



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder