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:
- Display BIM 360 Cost properties either in Raw data and Human readable form.
- Export BIM 360 Cost properties either in Raw data and Human readable form to a CSV file.
- 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.
https://bim360cost-exchange.herokuapp.com/
- Forge Account: Learn how to create a Forge Account, activate subscription and create an app at this tutorial.
- BIM 360 Account: must be Account Admin to add the app integration. Learn about provisioning.
- 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
- Node.js: basic knowledge with Node.js.
- 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.
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
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
- Make sure to Create BIM360 project, activate Cost Management module, setup project for Cost Management.
- Operate with App after setup
- Select a project and display BIM 360 Cost properties either in Raw data and Human readable form.
- Click Export button to export BIM 360 Cost properties either in Raw data and Human readable form to a CSV file.
- Click Import button to update BIM 360 Cost properties from a locally stored CSV file(based on Raw data).
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.
- BIM 360 Cost Management module needs to be activated to use this App, due to the current limitation of BIM 360 API, user needs to activate & setup cost project manually. Please check Create BIM360 project, activate Cost Management module, setup project for Cost Management for details.
- 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';
- Not all the properties could be updated, only these marked as Editable are supported.
- 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.
- 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.
Document:
- This sample is based on Learn Forge Tutorial, please check details there about the basic framework if you are not familar.
- Data Management API
- BIM 360 API and App Provisioning
- BIM 360 Cost Management API
- Create BIM360 project, activate Cost Management module, setup project for Cost Management
Tutorials:
Blogs:
- Forge Blog
- Field of View, a BIM focused blog
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Zhong Wu @johnonsoftware, Forge Partner Development