This sample demonstrates the following features:
- List parameters from ACC Account using Parameters API
- Add selected parameters from ACC Account to Revit project using Revit API
- Start Revit, Open a Revit project, goto
ACC Parameters
tab and clickACC Parameters
button, or gotoAdd-Ins
tab >External Tools
> select the commandCommand RevitParametersAddin
, login with your Autodesk credential - The
Parameters View Mananger
dialog pops up - Select ACC Hub, select collection, all the Revit compatible parameters will be listed
- Select the parameters, click
download parameter
button - Goto
Manage
Tab, and clickProject Parameters
button - The new parameters are added to the project parameters list
For details, please watch the following video:
- APS credentials
- Visual Studio Community 2022 or .NET 8
- Terminal (for example, Windows Command Prompt or macOS Terminal) if you don't have Visual Studio
If you have Visual Studio Community 2022 installed
- Clone this repository
- Build and run the project
If you do not have it installed
- Clone this repository
- Install dependencies:
dotnet restore
- Setup environment variables in the appsettings.json File:
ClientId
- your APS application client IDClientSecret
- your APS application client secret
- Run the project:
dotnet run
Currently the addin uses http://localhost:3000/api/aps/callback/oauth
as the callback. This callback should also be added at your application Callback URL in the General Settings section of your APS Application. The port can be changed to whatever port you wish by adding an environment variable "PORT".
Follow the Demonstration
section above to play with addin.
-
If you run the application and encounter an exception saying assembly
Autodesk.Forge
cannot be loaded, you can solve this by copying the assembly (together with dependencies) to the roaming folder of your Revit plugin. -
Before running the plugin, we need be able to communicate with 3 legged token callback over HTTP and HTTPS. At a minimum, you want to configure a URL registration and add a Firewall exception for the URL your service will be using. You can configure these settings with the Netsh.exe tool as follows:
netsh http add urlacl url=http://+:3000/api/aps/callback/oauth/ user=DOMAIN\user
- Please refer to Configuring HTTP and HTTPS for details.
- Access denied: If you get access denied error when running the addin authentication, please run Visual Studio in Administrator mode to get 3 legged authentication working
For more information, see the documentation:
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.