I have some Revit add-ins that are written for Revit 2019 or the versions below. Now I'm trying to upgrade the tools for Revit 2020, but it seems like there are some significant changes in API methods. Fortunately, some of them are backward compatible so I can just update the code with new API methods and use it for Revit 2020 and 2019. However, some of them only works for Revit 2020. (ex) ImageInstance.Create(Document, View, ElementId, ImagePlacementOptions
)
In this case, what would be the best way to keep the same code base compatible with different Revit versions? I can easily imagine using If Statement to determine a proper API method for each Revit version, but it doesn't seem ideal for the maintenance of the tool.
Any advice would be appreciated!