It’s common for ODA members to exchange data between multiple file formats, including both older and newer file formats. One example is using BimRv SDK to export .rvt/.rfa files to JSON format files. Using the TB_JsonExport module, you can export the following:
- All parameters contained in ListParam for all objects in the model
- Hierarchy of objects in the model
The TB_JsonExport module is used in the BmJsonExportEx sample application, which is a console application that demonstrates the export capabilities with the following startup parameters:
- Input file — .rfa or .rvt file (required).
- Output file — .Json file (optional).
- Element handle — OdDbHandle of an OdBmElement for export (optional).
- Flag — Use -p for exporting properties; use -h for exporting the object hierarchy. Must be the last argument (required).
The export example also works in the OdaBimApp sample application.
Exporting Parameters and Properties to a JSON Format File
To export parameters and properties:
- Open OdaBimApp and load any .rvt file.
- Choose File -> Export Property To Json.
- Select the path and name for the resulting .Json file.
It is also possible to export parameters for one specific object:
- Right-click the desired object in the Element Table.
- Choose Export Property for this Element.
- Select the path and name for the resulting .Json file.
You can also select one of the drawn objects in the Viewer:
- Choose Vectorize.
- Right-click the desired object.
- Choose Export Property for this Element.
- Select the path and name for the resulting .Json file.
The result of exporting the parameters is a .Json file with this structure:
The next article in this series will contain an example of exporting the hierarchy to a .Json file.