Search code examples
revit-apiautodeskforge

Upgrade Forge App to support Revit 2022 and Revit 2023 both


We are having Autodesk Forge App which takes Revit file as input and converts it to our custom format. To give an idea about the App, see below

enter image description here

So far the App is working fine and we are supporting the Revit File versions till 2022. With the upgrade of Revit 2023 which introduced many changes and removed some of the methods, we are facing a challenge. Basically we want to have the backward compatibility as well i.e. to support the file formats before Revit 2023 as well along with 2023.

Having given this background, my question is - As the backend uses Revit API, do we need to use two sets of backend codes which will internally use 2 separate DLLs ( Revit API 22 and 23) as shown below or is there any better alternative?

enter image description here


Solution

  • You have two options: implement a Revit add-in that supports both versions of the Revit API. That can be achieved using the .NET Reflection library and is a bit tricky. One example of doing so for the Revit API is provided by Magson Leone in the article on Compatibilizar entre versões – API Compatibility Helper. The other, and probably simpler option is to implement separate add-ins for different versions of the Revit API and specify which version of the Revit engine to run in your Design Automation app.