Is there a way through the js api to upload and retrieve a revit model? Im looking to get the same result as what your Cesium Revit plugin does but through my own js implementation.
Currently I seem limited to exporting an ifc from revit if keeping the metadata is important to me, which it is. Preferably I could hook into the service youre Revit addon uses so i can get the metadata and the textures both.
Thank you in advance.
Hi @Angry8bit,
Quick clarification first: there’s no upload functionality in the CesiumJS API itself. If that’s what you meant, the piece you’re looking for is the Cesium ion REST API, which you can call from your own JavaScript (Node or browser). I’ll assume that’s the goal below, but let me know if you meant something else.
Good news beyond that: the Revit add-in doesn’t use any private service. It’s open source (GitHub - CesiumGS/cesium-ion-revit-add-in · GitHub), and everything it does goes through that same public REST API.
What the add-in actually does:
- Uses the Revit API locally to export the active 3D View into an intermediate glTF-based format. With the metadata option enabled, all instance and type parameters of each element are included. Texture support covers base color and opacity, not full PBR material maps.
- Zips that export and creates an asset with
POST /v1/assets, using type: "3DTILES" and options.sourceType: "BIM_CAD" (plus options.inputCrs with an EPSG code when shared coordinates are used).
- Uploads the zip to the S3 location returned by that call, then notifies the
onComplete endpoint. ion tiles it server side.
If you want to trace that flow in the code: CesiumIon/Connection.cs has the REST calls and OAuth sign-in, Forms/IonUploadDialog.cs is where the upload options are set, and ExternalApplication.cs handles the export and zipping. The catch: step 1 needs the Revit API running inside Revit, so a pure JS implementation can’t reproduce the export itself (Autodesk’s Design Automation service can run Revit API code in the cloud if you ever need that route).
Depending on your pipeline, you may not need that flow at all though, and I’d recommend you don’t. The ion tiling pipeline accepts .rvt files directly now, functionality released in the last month or two (listed under BIM/CAD in the supported formats: Tiler Data Types and Formats – Cesium, some further reading here Tiling BIM/CAD Models – Cesium). You can upload via the Ion Dashboard or from your own JS you can upload the .rvt itself using the REST API with sourceType: "BIM_CAD", and I believe ion extracts the geometry and BIM data server side, no IFC export needed. The upload flow is covered in this tutorial: Upload with REST – Cesium. Since metadata and textures are the parts that matter to you, I’d test both paths with one of your models and compare: the add-in reads materials and parameters through Revit itself, so results can differ from server-side .rvt tiling.
If your app should let other users upload into their own ion accounts, ion supports OAuth 2.0 for that (it’s how the add-in signs in): Use OAuth2 with Cesium ion – Cesium
Hope that helps, let us know how it goes!