Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

[Deprecated]Code sample to demonstrate how to exchange data between BIM360 Cost Management and CSV file

License

Notifications You must be signed in to change notification settings

Autodesk-Forge/forge-bim360.costmanagement.exchange.csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED

This repository has been deprecated and all its content was moved to the new one located here https://github.com/autodesk-platform-services/aps-acc-cost-exchange

forge-bim360.costmanagement.exchange.csv

Node.js npm Platforms Data-Management

BIM-360 Cost Management

MIT Level

Description

This sample demonstrates exchanging properties of Budget, Contract, Cost item and Change Order between cost module and .CSV file using BIM 360 Cost Management API. It includes 3 main tasks:

  1. Display BIM 360 Cost properties either in Raw data and Human readable form.
  2. Export BIM 360 Cost properties either in Raw data and Human readable form to a CSV file.
  3. Import BIM 360 Cost properties from a locally stored CSV file(based on Raw data).

This sample is implemented based on Node.js version of Learn Forge Tutorial, please refer to https://learnforge.autodesk.io/ for the details about the framework.

Thumbnail

thumbnail

Demonstration

https://youtu.be/X6mFX_yqhTI

Live Demo

https://bim360cost-exchange.herokuapp.com/

Web App Setup

Prerequisites

  1. Forge Account: Learn how to create a Forge Account, activate subscription and create an app at this tutorial.
  2. BIM 360 Account: must be Account Admin to add the app integration. Learn about provisioning.
  3. BIM 360 Cost Management: Create BIM 360 project, activate Cost Management module, setup project to create Budget Code Template for Cost Management according to the guide
  4. Node.js: basic knowledge with Node.js.
  5. JavaScript basic knowledge with jQuery

For using this sample, you need an Autodesk developer credentials. Visit the Forge Developer Portal, sign up for an account, then create an app. For this new app, use http://localhost:3000/api/forge/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-Forge/forge-bim360.costmanagement.exchange.csv

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 FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
export FORGE_CLIENT_SECRET=<<YOUR CLIENT SECRET>>
export FORGE_CALLBACK_URL=<<YOUR CALLBACK URL>>

npm start

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

npm install
set FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
set FORGE_CLIENT_SECRET=<<YOUR CLIENT SECRET>>
set FORGE_CALLBACK_URL=<<YOUR CALLBACK URL>>

npm start

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 Create BIM360 project, activate Cost Management module, setup project for Cost Management.
  • Operate with App after setup
  1. Select a project and display BIM 360 Cost properties either in Raw data and Human readable form.
  2. Click Export button to export BIM 360 Cost properties either in Raw data and Human readable form to a CSV file.
  3. Click Import button to update BIM 360 Cost properties from a locally stored CSV file(based on Raw data).

Deployment

To deploy this application to Heroku, the Callback URL for Forge 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 Forge.

Deploy

Limitation

Known issues

  1. The 'scopeOfWork' property contain rich text which may includes '\n' and ',', but the 2 characters are reserved for special usage while parsing CSV file, to avoid the issue, I use the following 2 characters as replacement for 'scopeOfWork' property.
        const Enter_Replacement = '\xfe';
        const Comma_Replacement = '\xfd';

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 BIM 360 cost module.

Troubleshooting

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

Further Reading

Document:

Tutorials:

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, Forge Partner Development