Giter VIP home page Giter VIP logo

bim360appstore-model.derivative-nodejs-xls.exporter's Introduction

Export to Excel with Model Element Data

Platforms License

oAuth2 Data-Management Model-Derivative Viewer

Thumbnail

thumbnail

Demo Video

thumbnail

Description

This sample application demonstrates how to extract metadata of model on your Autodesk360, BIM360 or Autodesk Construction Cloud(ACC) account, into an excel spreadsheet. The sample code demonstates 3-legged OAuth, a simple viewer extension and code to handle meta-data and format it into an excel spreadsheet file.

In the project tree of this sample, Autodesk360, BIM360 and ACC project are listed with different icons.

Live version

https://forge-exportxls.autodesk.io

Video: Youtube

Setup

For using this sample, you need to log into your Autodesk developer account. Visit the Forge Developer Portal and sign up for an account, then create an app. When asked for the 'callback URL' in your new app, use http://localhost:3000/api/forge/callback/oauth. Finally take note of the Client ID and Client Secret.

Run locally

Install NodeJS.

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-Forge/forge-exportxls

To run it, install the required packages, 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 FORGE DEVELOPER PORTAL>>
export FORGE_CLIENT_SECRET=<<YOUR FORGE CLIENT SECRET>>
npm run dev

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

npm install
set FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM FORGE DEVELOPER PORTAL>>
set FORGE_CLIENT_SECRET=<<YOUR FORGE CLIENT SECRET>>
npm run dev

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

Important: do not use npm start locally, this is intended for PRODUCTION only with HTTPS (SSL) secure cookies.

Deploy on Heroku

To deploy this application to Heroku, the Callback URL & redirect_uri 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 the correct callback URL.

Deploy

Watch this video on how deploy this sample to Heroku.

Packages used

All Autodesk Forge NPM packages are included by default, see complete list of what's available at NPM website. OAuth, Model Derivative and OSS are used. Some other non-Autodesk packaged are used, including express and its session/cookie middlewares (express-session and cookie-parser) for user session handling. The front-end uses bootsrap and jquery.

Tips & tricks

For local development/testing, consider use nodemon package, which auto restart your node application after any modification on your code. To install it, use:

sudo npm install -g nodemon

Then, instead of npm run dev, use the following:

npm run nodemon

Which executes nodemon server.js --ignore www/, where the --ignore parameter indicates that the app should not restart if files under www folder are modified.

Troubleshooting

  1. getProperties does not return data: In default, Get Properties endpoint can only respond with data if the resource < 20M. A query param forceget forces get the large resource even if it exceeded the expected maximum length (20 MB).

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

  3. Cannot load Autodesk360 model: In Autodesk360, the model is not translated by default until the end user loads the model one time in Autodesk360, or the developer posts job to translate.

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

Blogs

License

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

Written by

Developer Advocate and Support, Autodesk

bim360appstore-model.derivative-nodejs-xls.exporter's People

Contributors

augustogoncalves avatar dylantack avatar jaylimboonkiat avatar kimekeunkyung avatar libvarun avatar wallabyway avatar xiaodongliang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bim360appstore-model.derivative-nodejs-xls.exporter's Issues

Cannot read property 'forEach' of undefined

when I try to Exptort, I get this err:
ForgeXLS.js:189 Uncaught TypeError: Cannot read property 'forEach' of undefined
at Object.getAllElementsOnCategory (ForgeXLS.js:189)
at ForgeXLS.js:176
at Array.forEach ()
at Object.prepareRawData (ForgeXLS.js:174)
at ForgeXLS.js:166
at Object.success (ForgeXLS.js:44)
at i (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at A (jquery.min.js:4)
at XMLHttpRequest. (jquery.min.js:4)

XLS file does not download

Hi All,
will it take too long to create the data?
i did test it a sample model and i got the file. however, when i tried in a real model, the information is not download.
the process starts once i click the icon of excel... but them it does nothin else

BIM 360 Docs

BIM360 Team projects are available when using the tool, but not for BIM360 Docs projects.

Downloading large files

Does anyone have a suggestion regarding export of significantly large files?

The service works wonderfully, but when a file approaches 250Mb is size, the download is stuck on 'Preparing {filename}.xlsx' and 'Reading project information...'.

Is there, perhaps, a way to divide large files into categories of objects, and download several smaller sized .xlsx files?

Double click on version cause JS error

forge.viewer.js:53 Uncaught TypeError: Cannot read property 'search' of null
at onDocumentLoadSuccess (forge.viewer.js:53)
at viewer3D.min.js?v=v2.15:21
at k (viewer3D.min.js?v=v2.15:20)
at XMLHttpRequest.p (viewer3D.min.js?v=v2.15:4)

Cannot login in IE 11

Click on "Sign in", enter password, redirects back, still showing "Sign in" button (no tree)

413 error for big files.

If the file size is big and metadata is large, properties API is throwing '413 error' with message 'too large response'

Boostrap > 3.3

Known moderate severity security vulnerability detected in bootstrap >= 3.0.0, < 3.4.1 defined in package.json.

package.json update suggested: bootstrap ~> 3.4.1.

Random undefined on open model

Getting this error when trying to open the file, random, but maybe missing a "not null/undefeined check" is missing

viewer3D.min.js?v=v2.15:4 GET https://developer.api.autodesk.com/viewingservice/v1/undefined?domain=https%3A%2F%2Fbim360xls.herokuapp.com 400 (Bad Request)

  i.rawGet @ viewer3D.min.js?v=v2.15:4
  i.getManifest @ viewer3D.min.js?v=v2.15:4
  j @ viewer3D.min.js?v=v2.15:20
  d.load @ viewer3D.min.js?v=v2.15:20
  d.loadDocument @ viewer3D.min.js?v=v2.15:21
  ** onInitialized @ forge.viewer.js:42**

Not loading on Chrome or IE

I have tried to view the models on chrome and IE but nothing is loading. I can see the navigation tree and models and versions but on selecting the version nothing happens.

Sean

Page Unresponsive

Hi Community,
i have this issue each time i try to export to excel,
do you know the reason?

Screenshot 2022-04-27 114222
n

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.