Visualizing 3D rooms from a Revit model in Power BI.
In this tutorial you will learn how to visualize an abstract 3D rooms model that can be linked to any kind of data you have in Power BI. The tools needed to achieve this are:
- Autodesk® Revit® as the BIM application.
- 3DBI for Revit as the custom addin that is able to export Revit geometry and data to a format readable by our 3DBI visual.
- Microsoft® Power BI®
- 3DBI, the custom visual we developed for Power BI, shipped with the Revit addin.
- Data representing a schedule. In this demo we will be using a .csv file containing a scheduled maintenance date for each room.
1 – Exporting rooms, context and data from Revit.
For this tutorial we assume that you have a Revit model ready and populated with rooms. Please have a look at the official Revit documentation on how to create rooms if that is not the case.
Create an empty 3D view.
When exporting a Revit model to 3DBI, all objects that are visible in the active view will be exported. With the intention to not visualize any geometry other than rooms in our dashboard it is thus important to have no other objects visible in the active view during the export. Since rooms are not physically present in Revit models the view that is active during the export should be completely empty.
Create the 3DBI-Context 3D view.
3DBI also has the option to show static geometry. Static geometry is always visible, is not interactive, can not be selected and does not respond to selection in other parts of the resulting dashboard. The purpose of static geometry is to serve as context and to give the user a better spatial understanding of the physical location of other objects in the visual. In order for 3DBI to detect which geometry in the Revit model should result in static geometry a special 3D view has to be created, named 3DBI-Context and setup to only show those objects that should become static geometry in 3DBI.
Specify the options and export.
With the views setup it is time to specify the correct options. Make sure to check the “Export Context” option, the “Include Rooms & Spaces” option as well as the “json single elements array” option. This last option will also export a .json file containing different data fields of all exported business objects (rooms in this case) next to the resulting .3dbi file.
Make sure to activate the empty view and finally press the “Export” button to start the exporting process.
2 – Getting the 3D in Power BI
Start with the demo dashboard
3DBI for Revit comes shipped with an empty demo dashboard that already has a data source setup and comes with the custom 3DBI visual preloaded. The easiest route to open the folder containing that .pbix file is to go to the help page of 3DBI for Revit and press the “Open 3DBI visual directory with examples” button. In the folder that should be openend by Windows Explorer is a file named “empty_dashboard_with_viewer_and_data_source_preloaded.pbix” that can be opened with Power BI.
TIP: save the demo dashboard to its final location prior to going ahead with the next steps to make sure that the shipped demo dashboard is not altered.
Changing the datasource
Remember having checked the “json single elements array” option before exporting the Revit model to 3DBI? By checking that option, 3DBI did create a separate .json file containing many data fields of the exported elements (rooms) and saved it next to the exported .3dbi file. We will alter the source of the predefined ROOT query the shipped demo dashboard has and point it to that exported .json file.
Since the export only contains rooms, and rooms do not have an element type, we also delete the predefined Element Types query as well as the Document Info query the shipped demo dashboard comes with.
Finally we specify some new columns that exist in the exported .json file to also be part of the Elements query so we can use their values in this new dashboard.
Inserting the 3DBI model
With the data source updated the final step is to insert the exported .3dbi file into the preloaded 3DBI visual. First, assign the ID field of the Elements query to the Object Identifiers field of the visual, secondly, accept the license agreement and finally hit the insert model button.
After loading in the model you should see some abstract semi transparent room geometries placed in a static geometry context where it should be possible to select room object, but not contextual geometries.
TIP: since this model has geometry that represents the site it is better to uncheck the “Ground Shadow Plane” option the viewer comes with.
Display basic information
The datasource added to the dashboard already contains some basic information such as each room’s id, name and number. In a few clicks we can visualize this data by adding a table visual to the dashboard. Since the linked .json file also contains various other data fields (level name, perimeter, area, volume, …) we also add an additional column to the existing query to also include the name of each level the room is placed on.
3 – Link with scheduling information
The power of Power BI? Being able to link with multiple data sources and detect and utilize relationships between these different datasources. In this tutorial we bring in some scheduling information that exists in an external .csv file and that contains a maintenance date for each room number. Once the data has been linked in and a relationship has been setup that new information can be used to filter rooms in the 3DBI visual.
4 – Final steps
With all information being linked in we can now finalize our dashboard. We will experiment with a few different visuals, change the default color of all rooms by assigning a column to the Color By field and also alter the existing Elements query to bring some additional columns into the dashboard.