Skip to content

autodesk-platform-services/revit-parameters-export-addin

Repository files navigation

Revit Parameters Import

platforms Visual Studio Community 2022 .NET Revit 2024

OAuth2 .Parameters Service

Advanced MIT

Description

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

Thumbnail

thumbnail

Demonstration

  • Start Revit, Open a Revit project, goto ACC Parameters tab and click ACC Parameters button, or goto Add-Ins tab > External Tools > select the command Command 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 click Project Parameters button
  • The new parameters are added to the project parameters list

For details, please watch the following video:

  • https://www.youtube.com/watch?v=j6oEB_lrv9w

Setup

Prerequisites

Running locally

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 ID
    • ClientSecret - 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.

Further Reading

Tips & Tricks

  • 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

Troubleshooting

  • 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

Documentation

For more information, see the documentation:

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

Written by

Moturi Magati George, Autodesk Partner Development

About

This sample demonstrates displaying the parameters from ACC account and adding them into Revit project.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages