Skip to content

Exchange Information of Parameters Service Sample: This sample demonstrates displaying and exchanging parameters with CSV file in different ways

License

Notifications You must be signed in to change notification settings

autodesk-platform-services/aps-parameters.exchange

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aps-parameters.exchange

Node.js npm Platforms Data-Management

Parameters

MIT Level

Description

This sample demonstrates displaying and exchanging parameters in the following ways:

  1. Display Parameters properties and lable information either in Raw data and Human readable form.
  2. Export Parameters properties to a Shared Parameters txt file, and also import Parameters properties from a Shared Parameters txt file.
  3. Export Parameters properties either in Raw data and Human readable form to a CSV file, and also import Parameters properties from a locally stored CSV file(based on Raw data).

Thumbnail

thumbnail

Web App Setup

Prerequisites

  1. APS Account: Learn how to create a APS Account, activate subscription and create an app at this tutorial.
  2. ACC Account: must be Account Admin to add the app integration. Learn about provisioning.
  3. Node.js: basic knowledge with Node.js.
  4. JavaScript basic knowledge with jQuery

For using this sample, you need an Autodesk developer credentials. Visit the APS Developer Portal, sign up for an account, then create an app. For this new app, use http://localhost:3000/api/aps/callback/oauth as Callback URL. Finally take note of the Client ID and Client Secret.

Running locally

Install NodeJS, version 8 or newer.

Clone this project or download it (this nodejs branch only). It's recommended to install GitHub desktop. To clone it via command line, use the following (Terminal on MacOSX/Linux, Git Shell on Windows):

git clone https://github.com/Autodesk-Platform-Services/aps-parameters.exchange

Install the required packages using npm install.

Environment variables

Set the enviroment variables with your client ID & secret and finally start it. Via command line, navigate to the folder where this repository was cloned and use the following:

Mac OSX/Linux (Terminal)

npm install
export APS_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
export APS_CLIENT_SECRET=<<YOUR CLIENT SECRET>>
export APS_CALLBACK_URL=<<YOUR CALLBACK URL>>

npm start

Windows (use Node.js command line from Start menu)

npm install
set APS_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
set APS_CLIENT_SECRET=<<YOUR CLIENT SECRET>>
set APS_CALLBACK_URL=<<YOUR CALLBACK URL>>

npm start

Note. environment variable examples:

  • APS_CALLBACK_URL: http://localhost:3000/api/aps/callback/oauth

Using the app

Open the browser: http://localhost:3000.

Please watch the Video for the detail setup and usage, or follow the steps:

  • Setup the app before using the App
  1. Make sure to be the Account Admin for the ACC hub.
  • Operate with App after setup
  1. Select a Parameters Collection under an ACC account, all the parameters will be listed either in Raw data and Human readable form.
  2. Click Execute button to generate a Shared Parameters txt file by exporting to txt.
  3. Click Execute button to import ACC Parameters from a local Shared Parameters txt file.
  4. Click Execute button to export ACC Parameters either in Raw data and Human readable form to a CSV file.
  5. Click Execute button to update ACC Parameters by importing from a locally stored CSV file(based on Raw data).

Deployment

To deploy this application to Heroku, the Callback URL for APS must use your .herokuapp.com address. After clicking on the button below, at the Heroku Create New App page, set your Client ID, Secret and Callback URL for APS.

Deploy

Tips & Tricks

  1. Not all the properties could be updated, only these marked as Editable are supported.
  2. To import properties from CSV file, the suggested way is to export a CSV file of raw data first, update the editable properties within the file, then import it back to ACC Parameters.
  3. To convert between Shared Parameters and Parameters Service, there is a map maintain the relationship, the map used by the sample is not latest, please always use the following Revit API to iterate all the categories and get the latest map between shared parameters and parameters service.

Troubleshooting

  1. Cannot see my ACC account: Make sure to provision the APS App Client ID within the ACC account, learn more here. This requires the Account Admin permission.

Further Reading

Document:

Blogs:

License

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

Written by

Zhong Wu @johnonsoftware, Autodesk Partner Development

About

Exchange Information of Parameters Service Sample: This sample demonstrates displaying and exchanging parameters with CSV file in different ways

Topics

Resources

License

Stars

Watchers

Forks