Skip to content

Files and folders extraction sample:Sample to demonstrate how to retrieve data of all the folders and files on a specific project to show on a table and export it as CSV.

License

Notifications You must be signed in to change notification settings

autodesk-platform-services/aps-hubs-recursive-extraction

Repository files navigation

Files and folders extraction sample

Platforms .NET License

oAuth2 Data-Management BIM360 ACC

Advanced

Description

This sample demonstrate how to retrieve data of all the folders and files on a specific project to render on a table and export it as csv. This sample recursively iterate through all folders of the selected project. It works by traversing the entire folder structure and sending the individual contents to the client one by one. Every file and folder under the selected project are rendered on the user table and can be exported as csv.

Thumbnail

thumbnail

Live version

Try it at https://aps-hubs-recursive-extraction.autodesk.io/

DEMO VIDEO

thumbnail

Setup

Prerequisites

  1. APS Account: Learn how to create a APS Account, activate subscription and create an app at this tutorial.
  2. Visual Studio: Either Community (Windows) or Code (Windows, MacOS).
  3. .NET Core basic knowledge with C#
  4. HangFire: Library for dealing with queueing. [learn more] (https://www.hangfire.io).

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-hubs-recursive-extraction

Visual Studio (Windows):

Right-click on the project, then go to Debug. Adjust the settings as shown below. For environment variable, define the following:

  • ASPNETCORE_ENVIRONMENT: Development
  • APS_CLIENT_ID: your id here
  • APS_CLIENT_SECRET: your secret here
  • APS_CALLBACK_URL: http://localhost:8080/api/aps/callback/oauth

Visual Sutdio Code (Windows, MacOS):

Open the folder, at the bottom-right, select Yes and Restore. This restores the packages (e.g. Autodesk.Forge) and creates the launch.json file. See Tips & Tricks for .NET Core 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:8080",
  "APS_CALLBACK_URL": "http://localhost:8080/api/aps/callback/oauth",
  "APS_CLIENT_SECRET": "your client secret here",
  "APS_CLIENT_ID": "your client Id here"
},

Open http://localhost:3000 to start the app. Select Index my BIM 360 Account before using (this process may take a while). Check the http://localhost:3000/dashboard to see the jobs running (Hangfire dashboard).

Further Reading

Documentation:

Other APIs:

Tips & Tricks

This sample uses .NET Core and works fine on both Windows and MacOS, see this tutorial for MacOS.

Troubleshooting

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

  2. error setting certificate verify locations error: may happen on Windows, use the following: git config --global http.sslverify "false"

License

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

Written by

João Martins in/jpornelas, APS Partner Development

About

Files and folders extraction sample:Sample to demonstrate how to retrieve data of all the folders and files on a specific project to show on a table and export it as CSV.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published