This article details how to convert Revit data to OGC 3D Tiles.

If you want to visualize large Revit datasets and maintain application performance, you must convert the Revit data to the OGC 3D Tiles format. OGC 3D Tiles is an optimal format for visualizing large geographical datasets. After the conversion, you can visualize the data on a Lightspeed view, as explained in the Visualize OGC 3D Tiles data on a Lightspeed map article.

LuciadFusion can natively serve Revit data as an OGC 3D Tiles service. For that use case, you don’t need a manual conversion to OGC 3D Tiles.

Check the LuciadFusion documentation for more information on how to serve the Revit data as OGC 3D Tiles.

To convert the Revit data to OGC 3D Tiles, you have two options: you can perform the conversion programmatically, or you can run a Revit data conversion script from the command line.

Converting Revit data to OGC 3D Tiles in your code

To convert Revit data to OGC 3D Tiles:

  1. Decode the Revit data into an ILcdModel using the TLcdRevitModelDecoder.

    ILcdModelDecoder decoder = new TLcdRevitModelDecoder();
    ILcdModel model = decoder.decodeSource(new TLcdBIMDataSource(sourceName, TLcdBIMDataSource.Type.GEOMETRY));
  2. Encode the generated model to OGC 3D Tiles using a TLcdOGC3DTilesModelEncoder:

    TLcdOGC3DTilesModelEncoder encoder = new TLcdOGC3DTilesModelEncoder();
    encoder.export(model, outputPath);

The resulting OGC 3D Tiles dataset is written to the given outputPath location.

Converting Revit data to OGC 3D Tiles from the command line

To convert Revit data to OGC 3D Tiles from the command line, go to the samples folder, and select the appropriate script to run:

  • decoder.revit.bat on Windows systems

  • decoder.revit.sh on Linux and Mac systems

For example:

decoder.revit.bat -i D:\Formats\Revit\someRevitFile.rvt -o C:\Users\user1\3dtilesoutput

You must run the script with these parameters:

  • -i path/to/<projectfile>: specify the Revit RVT file.

  • -o path/to/output/: specify the path to the output folder for the OGC 3D Tiles.

Adding georeference information

The converter will ignore any georeference information stored in the Revit file. To geolocate the Revit data, make sure that georeference information is available in the input folder with Revit data. You can provide georeference information in a .llh, .ref, or .prj file with the same name as the data file.

.llh files contain longitude, latitude, and height, defined in the default EPSG 4326 reference.

Optionally, you can add the -g and -m command parameters:

  • You can use the -g command parameter to add a GeoJSON file to the output folder.

    decoder.revit.bat -g -i D:\Formats\Revit\someRevitFile.rvt -o C:\Users\user1\3dtilesoutput

    The GeoJSON file contains the metadata of the individual elements in the Revit data, such as doors and walls. A bounding box is also included, but not the full geometry. For more information about GeoJSON conversion, see the Converting Revit data to GeoJSON tutorial.

  • You can use the -m command parameter to specify the mesh compression you want to apply. You can set it to either DRACO or NONE. See ELcdOGC3DTilesMeshCompressionType for more information about the meaning of these values. If this parameter is not specified, the DRACO compression is used.

    decoder.revit.bat -m DRACO -i D:\Formats\Revit\someRevitFile.rvt -o C:\Users\user1\3dtilesoutput