Giter Club home page Giter Club logo

autodesk-forge / viewer-javascript-extract.spreadsheet Goto Github PK

View Code? Open in Web Editor NEW
35.0 15.0 25.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

CSS 1.79% HTML 11.09% JavaScript 87.12%
model-derivative viewer javascript xls

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

viewer-javascript-extract.spreadsheet's People

Contributors

augustogoncalves avatar benglin avatar jaylimboonkiat avatar kimekeunkyung avatar petrbroz 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  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  avatar  avatar

viewer-javascript-extract.spreadsheet's Issues

workshared RVT won't work

attached pls find the stripped RVT, and output Excel file after i added "if (category)" in code, looks like it's related to levels in workshared RVT, non-worksharing RVT works OK, another finding is that if i changed levels workset from "Shared Levels and Grids" to "Workset1", then it runs infinite loop at "Downloading hierarchy...", thanks. Joe
image
NEX1075_HSK_ARC_STN_WIP_A.rvt (2) (1).xlsx

Revit plugin

Hello,
Any idea how to connect this solution to be used in a Revit plugin?
Thank you!

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.