Giter Club home page Giter Club logo

seashell-scientist / viewer-javascript-extract.spreadsheet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from autodesk-forge/viewer-javascript-extract.spreadsheet

0.0 0.0 0.0 14.2 MB

Extract Revit Properties into Excel: This sample uses Model Derivative API endpoints to read a Revit project properties and create a XLSX Excel file with one sheet for each type/category with all objects on it

Home Page: https://viewerxls.autodesk.io

License: MIT License

JavaScript 87.12% CSS 1.79% HTML 11.09%

viewer-javascript-extract.spreadsheet's Introduction

viewer-javascript-extract.spreadsheet

JavaScript sample to extract Revit files from Model Derivative API as Spreadsheet (Excel XLSX)

Viewer License Model-Derivative

Description

This sample uses Model Derivative API endpoints to read a Revit project properties and create a XLSX Excel file with one sheet for each type/category with all objects on it. Non-Revit files are not supported (different structure). Here is another version for desktop.

thumbnail

Demonstration

Run it live at this page, or locally by following these steps:

  • create a Forge application if you don't have one yet (tutorial)
  • make sure you have at least one file prepared for viewing (tutorial)
  • clone this git repository
  • navigate to the repository root folder and install npm dependencies
    • on Windows/macOS/Linux: npm install
  • prepare required environment variables
    • on Windows:
      set FORGE_CLIENT_ID=<your client id>
      set FORGE_CLIENT_SECRET=<your client secret>
      set FORGE_BUCKET=<your data bucket>
      
    • on macOS/Linux:
      export FORGE_CLIENT_ID=<your client id>
      export FORGE_CLIENT_SECRET=<your client secret>
      export FORGE_BUCKET=<your data bucket>
      
  • run the application
    • on Windows/macOS/Linux: npm run dev
  • go to http://localhost:3000

Usage

Add reference to the ForgeXLS file:

<script src="ForgeXLS.js"></script>

Then call downloadXLSX method passing the URN and a data:read token.

function downloadExcel() {
   ForgeXLS.downloadXLS(theURN, token, statusCallback /*Optional*/);
}

Dependencies

This project depends on Sheet JS to manipulate spreadsheet files. The FileSaver library is used to create & download a file on the client. BlobJS is required for older browsers (see compatibility). jQuery is also used.

<script src="jquery.min.js"></script>
<script src="Blob.js"></script>
<script src="FileSaver.min.js"></script>
<script src="xlsx.core.min.js"></script>

License

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

Written by

Augusto Goncalves @augustomaia, Forge Partner Development

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.