Reputation: 7332
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?
Upvotes: 0
Views: 1225
Reputation: 78
The right way is not to rely on Revit being installed on a device at all. That will enable you to do CI/CD and builds on the server in the future.
You have two possibilities to achieve that:
I prefer the first option since there are not available official nugets from Autodesk .
Upvotes: 1