When you read this, I will already be sitting on the plane back from New York to Switzerland.
Before leaving, though, I wanted to add some more explanations on the extremely fruitful work we accomplished this weekend.
I am very happy and grateful that we spontaneously formed such a wonderful team and worked together so enthusiastically, pleasantly and effectively.
Most of all, I enjoyed the companionship, competence and professionality of my closest teammate Matt Mason of Imaginit Technologies.
In the short AEC Hackathon project description that I published yesterday, I mentioned our new three.js based open source AEC visualisation project va3c to view 3D building models in any web browser.
The entire va3c team ended up proudly winning the second place in the Hackathon competition, and each project participant was awarded an Arduino as a prize.
Here are more details on the RvtVa3c Revit va3c exporter project that I completed together with Matt in a total effort of 2 * 26 hours = 52 man hours.
The entire source code, Visual Studio solution and add-in manifest is provided in the RvtVa3c GitHub repository.
The other projects, especially the central viewer component fed by the Revit add-in component, can be copied or cloned from their respective own repositories listed below.
Short RvtVa3c Project Description
Implement a Revit add-in external application, external command and custom exporter extracting information straight from the Revit graphics output pipeline and streaming it to a three.js scene version 4 JSON model file for consumption and display in the va3c AEC viewer, including support for meta-data and Internet hyperlinks.
Task List and Features
- Done:
- Properly handle instance transformation, e.g. doors and windows
- Properly handle colour and material
- Support transparency, e.g. window panes
- Get completely fed up with the buggy Microsoft System.Runtime.Serialization.Json.DataContractJsonSerializer class and switch to the more reliable Json.NET component
- Add scaling to common viewer size, e.g. [(0,0),(20000,20000)]
- Implement the external application ribbon panel and button
- Implement element properties, i.e. metadata support
- Eliminate multiple non-element materials
- Prompt user for output file name and location
- Eliminate null element properties, i.e. useless JSON userData entries
- Fix the GitHub repository corrupted by adding an excessively large file exceeding the 100 MB GitHub size limit
- Todo:
- More optimisations to reduce file size
- More intelligent family instance and type reuse
I could spend hours discussing each one of the steps listed above, more hours than Matt and I spent implementing them.
I can also save some time and breath and let you explore them for yourself.
Suffice to say that the Revit add-in is up and running, reliably producing version 4 three.js rendering of both small and large Revit models, and that the va3c viewer and all the other different va3c exporters work reliably as well.
Main Challenge
The target JSON format was initially a moving target, oscillating between version 3 and 4, both of which are nowhere completely reliably defined, requiring hard-core reverse engineering of the viewer by extensive JavaScript debugging.
We settled for version 4 in the end, since 3 is announced soon to be deprecated.
Links to Related Va3c Projects
- va3c project landing page
- viewer – HTML viewer
- GHva3c – Grasshopper va3c exporter
- maxscriptVa3c – 3DS Max va3e JSON Exporter
- json – JSON sample files
- va3c – web viewer for AEC models organisation
- va3c viewer demo