Skip to content

ACC Locations Manager:This repository demonstrates how to manage ACC Locations data and import locations from the selected Revit model.

License

Notifications You must be signed in to change notification settings

autodesk-platform-services/aps-acc-locations-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACC Locations Manager Sample

Platforms .NET MIT

oAuth2 Data-Management ACC Locations API ACC Model Properties API

Level

Description

This sample demonstrates the following use cases:

  • View Locations tree (included sub-location nodes) similar to ACC Admin Locations UI.
  • Add Locations node
    • Add sub-locations nodes
    • Add node before and after the target node. (in the same tree tier)
  • Edit and delete the Locations node.
  • Import Locations (Levels & Rooms) from the selected Revit model via using Model Properties API

Thumbnail

thumbnail

Demonstration

Here is the video demonstrating how this sample works quickly.

Web App Setup

Prerequisites

  1. APS Account: Learn how to create a APS Account, activate your subscription, and create an app at this tutorial.
  2. ACC Account: must be Account Admin to add the app integration. Learn about provisioning.
  3. Visual Studio: Either Community 2019+ (Windows) or Code (Windows, MacOS).
  4. .NET 7 basic knowledge with C#
  5. JavaScript basic knowledge with jQuery

Running locally

Clone this project or download it. 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-acc.locations.manager

Visual Studio (Windows):

Right-click on the project, then go to Debug. Adjust the settings as shown below.

Visual Studio Code (Windows, MacOS):

Open the folder, at the bottom-right, select Yes and Restore. This restores the packages and creates the launch.json file. See Tips & Tricks for .NET on MacOS.

At the .vscode\launch.json, find the env vars and add your APS Client ID, Secret, and callback URL. Also, define the ASPNETCORE_URLS variable. The end result should be as shown below:

"env": {
    "ASPNETCORE_ENVIRONMENT": "Development",
    "ASPNETCORE_URLS" : "http://localhost:3000",
    "APS_CLIENT_ID": "your id here",
    "APS_CLIENT_SECRET": "your secret here",
    "APS_CALLBACK_URL": "http://localhost:3000/api/aps/callback/oauth",
},

Run the app. Open http://localhost:3000 to view your files. It may be required to Enable my ACC Account (see app top-right).

Use Cases

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

  2. After user logging, select a project or click either tree nodes in the read line. It will load the Locations data for the selected project from the Locations service.


  3. Once Locations are loaded, we can see the root node called Project on the right side. When right-clicking on it, we can create the first location node.



  4. When right-clicking on the non-root-typed location node, there are 4 supported operations:


    • Add sub-location node: To add child nodes for this node.

    • Add peer location node: To add a node in the same tier/depth for this node.

    • Update location data: To update the name or barcode for this node.

    • Delete this location: To Delete selected node.

  5. When right-clicking on the model version node, the Import locations from this model feature will pop up. We can use it to fetch locations from the selected Revit model and import the result to Location service.


    5.1 Click Start here to start the importing task, and then it will prompt a warning that all existing location nodes will be deleted before importing.


    5.2 This sample will start using model properties API to query levels and rooms from the Revit model, and then import the result to the Location service.



Deployment

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

Deploy

Watch this video on how to deploy samples to Heroku.

Further Reading

Documentation:

Tutorials:

Blogs:

Tips & Tricks

This sample uses .NET and works fine on both Windows and MacOS. See this tutorial for MacOS.

License

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

Change Log

  • 09/03/2022: First release.
  • 11/22/2022: Update readme.
  • 12/07/2022: Migrated to use Startup.cs approach to configure the app.
  • 02/17/2023: Migrated to .NET 7.

Written by

Eason Kang in/eason-kang-b4398492/, Developer Advocacy and Support Team

About

ACC Locations Manager:This repository demonstrates how to manage ACC Locations data and import locations from the selected Revit model.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published