Generating construction assets directly from Revit model is one scenario which focus on assets preparation. For example, a MEP model, there might be thousands of devices, customer has the requirement to automatically generate all of these devices directly from the design model into BIM 360 Assets.
This sample demonstrates extracting assets information of Revit element directly from model under BIM 360 using design automation service.
The sample also provides the ability to import the generated assets directly into BIM 360 Assets Management module.
https://revit-da-assets-bim360.herokuapp.com
- Create a Revit Plugin to be used within AppBundle of Design Automation for Revit. Please check PlugIn
- Create your App, upload the AppBundle, define your Activity, you can simply use the Configure button in the Web Application to create the Appbundle & Activity. Or you can use Postman to do that according to this tutorial and repo
- Create the Web App to call the workitem.
- Forge Account: Learn how to create a Forge Account, activate subscription and create an app at this tutorial.
- BIM 360 Account: must be an Account Admin to add the app custom integration, or invited by an admin of a BIM 360 Account. Learn about provisioning.
- BIM 360 Assets Management: Create BIM 360 project, activate Assets Management module.
- Visual Code: Visual Code (Windows or MacOS).
- Revit 2020 & Visual Studio 2017: required to compile changes into the plugin
- ngrok: Routing tool, download here
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-revit.extract.assets-bim360
Install the required packages using npm install
.
ngrok
Run ngrok http 3000
to create a tunnel to your local machine, then copy the address into the FORGE_WEBHOOK_URL
environment variable. Please check WebHooks for details.
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>>
export FORGE_WEBHOOK_URL=<<YOUR DESIGN AUTOMATION FOR REVIT 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>>
set FORGE_WEBHOOK_URL=<<YOUR DESIGN AUTOMATION FOR REVIT 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 the Forge App is integrated with your BIM 360 account, please click Enable my BIM 360 Account button and follow the steps to finish the integration.
- Make sure to create Revi Design Automation Appbundle & activity, click Configure button, select local AppBundle and Engine to create. Currently, Revit 2019|2020|2021 engines are all supported.
- Make sure to Create BIM360 project, activate Assets Management module.
- Operate with App after setup
- Select Revit file version in BIM360 Hub to view the Model, Click
Extract Assets from the model
button, it will extract the assets info for each Revit element. - Clike
Create to BIM360
, it will import the generated assets directly into BIM 360 Assets Management module. - Open
BIM 360 Assets Management
module, check the assets.
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, Callback URL and Revit Design Automation variables for Forge.
Watch this video on how deploy samples to Heroku.
- The sample is using autodesk.forge.designautomation SDK.
- The Autodesk Forge packages is included by default. Some other non-Autodesk packaged are used, including socket.io, express.
Documentation:
-
This sample is based on Learn Forge Tutorial, please check details there about the basic framework if you are not familar.
-
Data Management API
Desktop APIs:
Tools
- BIM 360 Assets Management module needs to be activated to use this App.
- The sample use the local endpoint to accept the outputJson file which is generated by the Revit cloud engine, this help improve the performance.
- While importing assets to BIM 360 Assets Management module, the category will be created if it's not existing, and the default status(Specified) of asset will be used if the status is not existing.
-
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.
-
After installing Github desktop for Windows, on the Git Shell, if you see a error setting certificate verify locations error, use the following:
git config --global http.sslverify "false"
- Currently Revit Cloud Worksharing is not supported by the Design Automation. The scenario that this sample demonstrates is applicable only with a file-based Revit model.
- Client JavaScript requires modern browser.
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