autodesk-platform-services / aps-extract-spreadsheet

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

Home Page:https://aps-extract-spreadsheet.autodesk.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extract Revit Properties into Excel

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 an APS 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 APS_CLIENT_ID=<your client id>
      set APS_CLIENT_SECRET=<your client secret>
      set APS_BUCKET=<your data bucket>
      
    • on macOS/Linux:
      export APS_CLIENT_ID=<your client id>
      export APS_CLIENT_SECRET=<your client secret>
      export APS_BUCKET=<your data bucket>
      
  • run the application
    • on Windows/macOS/Linux: npm run dev
  • go to http://localhost:3000

Usage

Add reference to the ExportXLS file:

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

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

function downloadExcel() {
   ExportXLS.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, APS Partner Development

About

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

https://aps-extract-spreadsheet.autodesk.io/

License:MIT License


Languages

Language:JavaScript 85.9%Language:HTML 12.4%Language:CSS 1.7%