This project is a BIM (Building Information Modeling) viewer integrated directly into Google Docs as a Workspace Add-on. It allows users to load local .ifc files, navigate the 3D model, and copy snapshots into their documents, leveraging the power and efficiency of the ThatOpen/engine_fragment library.
The goal is to provide a seamless experience for viewing and capturing BIM models within the familiar Google Docs environment, enhancing documentation and collaboration for architectural, engineering, and construction (AEC) professionals.
- Google Docs Integration: Runs as a modern Google Workspace Add-on with a clean, dialog-based UI.
- Local IFC File Support: Automatically parses and displays
.ifcfiles selected from the user's local machine. - High-Performance Viewing: Utilizes
@thatopen/fragmentsfor model processing and@thatopen/componentsfor the basic scene, camera, and renderer setup. - Interactive Navigation: Allows users to pan, zoom, and orbit 3D models within the viewer dialog.
- Snapshot to Clipboard: Users can capture the current view of the model and copy it to their clipboard as an image, ready to be pasted into the document.
- (Next Up) Google Drive Integration: Load
.ifcfiles directly from Google Drive share links. - Advanced Navigation Tools: Implement viewer tools from
@thatopen/components, like "fit to view" and creating section planes, once they are fully compatible with the latest fragments library. - Element Inspection: Click on model elements to view their properties.
- Basic Measurement Tools: Simple distance and area measurements.
- Advanced model interaction: Sectioning, hiding/isolating elements, annotations.
- Core BIM Engine: ThatOpen/engine_fragment
@thatopen/fragmentsfor IFC import and model management.@thatopen/componentsfor scene setup, rendering, and future tooling.
- Platform: Google Workspace
- Google Docs Add-on framework.
- Google Apps Script for backend logic and UI management.
- Frontend: HTML, CSS, and modern JavaScript (ESM) loaded via CDN.
- Development:
claspfor local development and deployment.
- Launch Add-on: The user opens the "BIM Viewer" from the Google Docs add-on menu.
- Load Model: A dialog window appears. The user selects a local
.ifcfile, which is then automatically loaded into the interactive 3D viewer. - Navigate & Position: The user navigates the 3D model using standard mouse controls (pan, zoom, orbit) to find the desired viewpoint.
- Capture Snapshot: The user clicks the "Copy Snapshot to Clipboard" button.
- Paste: A PNG image of the current view is copied to the user's clipboard, ready to be pasted directly into the Google Document.
- Phase: Version 1.0 Complete (Local File POC)
- Next Steps:
- Implement Google Drive API integration to allow loading
.ifcfiles from a URL. - Add more robust error handling and user feedback.
- Implement Google Drive API integration to allow loading
Since this add-on is not yet on the Google Workspace Marketplace, you can install it manually for your own use by following these steps.
- Go to script.google.com and click New project.
- Delete the boilerplate code inside the
Code.gsfile. Copy the contents of this repository'sgoogle-apps-script/Code.gsfile and paste it into the editor'sCode.gsfile. - Click the + icon next to "Files" and select HTML. Name the new file
Sidebar.html(including the.htmlextension) and click OK. Delete the boilerplate code, then copy and paste the contents of this repository'sgoogle-apps-script/Sidebar.htmlinto your newSidebar.htmlfile. - Repeat the process: create another HTML file named
main.js.html. Copy and paste the contents from this repository'sgoogle-apps-script/main.js.html. - Click the Project Settings (gear icon) on the left. Check the box for "Show
appsscript.jsonmanifest file in editor". - Return to the Editor (
<>icon). Click on theappsscript.jsonfile. Delete its contents and replace them with the contents of this repository'sgoogle-apps-script/appsscript.json. - Click Save project.
This is required so Google knows you are giving the script permission to run.
- Go to the Google Cloud Console and create a new project. Give it any name you like.
- Once the project is created, find and copy its Project Number from the "Project info" card on the main dashboard.
- In the Google Cloud Console, navigate to APIs & Services > OAuth consent screen.
- Choose External for the User Type and click Create.
- On the next page, provide an App name (e.g., "My BIM Viewer"), a User support email (your own email), and your email again for the Developer contact information. Click SAVE AND CONTINUE.
- Skip the "Scopes" page by clicking SAVE AND CONTINUE.
- On the "Test users" page, click + ADD USERS and add your own Google email address. Click ADD, then SAVE AND CONTINUE.
- Go back to your Apps Script project. Click Project Settings (gear icon).
- Scroll down to "Google Cloud Platform (GCP) Project" and click Change project.
- Paste the GCP Project Number you copied earlier and click Set project.
- Open any Google Doc (or refresh one you already have open).
- A new "BIM Viewer" menu should appear in the main menu bar.
- Click BIM Viewer > Launch. The first time, it will ask for authorization. Accept the permissions you configured.
- The viewer dialog will appear, ready to use!
This project heavily relies on the excellent open-source work done by the creators of the ThatOpen/engine_fragment library. Their efforts in providing an efficient and accessible BIM toolkit are greatly appreciated.
This README is a living document and will be updated as the project progresses.