I would like to add the reference to "RevitAPI.dll" & "RevitAPIUI.dll" as a relative reference in Visual Studio 2022.
Whenever I add them by navigating to C:\Program Files\Autodesk\Revit 2021\RevitAPI.dll
, Visual Studio adds it as a absolute path like this - ..\..\..\..\..\..\Program Files\Autodesk\Revit 2021\RevitAPI.dll
The problem here is that when we clone this across devices, this path may not be correct because the respective developer may clone it in their own desired location.
I've noticed in few OpenSource projects that the HintPath
was like this: $(ProgramW6432)\Autodesk\Revit 2017\RevitAPI.dll
. But when I open those projects in Visual Studio 2022, the reference is not working.
So what is the right way to add a reference to Revit API? Is it possible to add a Relative reference?