Loading BIM models into Unity can be a bit of a hassle, especially when you have to deal with multiple file formats and complex geometries. Since 3D Repo utilises Unity on the Web, you can pull any 3D Model from 3D Repo Cloud directly into Unity. This is an ideal solution for building your custom applications and saving you a lot of time. You will benefit from the following:
Dynamically change assets
Multiple file format support (RVT, DGN, IFC, FBX & more)
Access all of the BIM data via APIs
Highly-optimised model geometry
Before we begin, make sure you download our SampleUnityProject zip folder from the 3D Repo's GitHub page. The SampleUnityProject contains everything you need for importing BIM models directly into Unity from the 3D Repo cloud.
Load the Project
Launch Unity Hub and click on the ADD button. Select the SampleUnityProject folder in the 3drepo4unity-master folder from GitHub. Select Unity Version 2020 or above and launch the project.
Add the Example Script
In the Inspector panel click on the Add Component button. This will show you the list of available files, search for Example Script. Click on the component to add it to your project.
Example Script Parameters
Enter the following information in the fields provided:
API Key (for authentication)
Teamspace (name of the teamspace where model resides)
Model ID (Unique model ID is available in the model settings menu)
Using 3D Repo's APIs, we'll make a GET request to pull a 3D BIM model from 3D Repo into Unity.
Load the model into Unity
Now that you have specified all of the information required Click on the play button to load your model into Unity. Note that the default camera position may not initially reveal your model. If that's the case, simply adjust your camera position or click pause to navigate over to your model.
That's all, now you can build a custom application that interacts with the 3D Model however you like. The best thing is that if you publish a new model revision to 3D Repo, it will become available to download into your Unity application.
To find out how you can add more information to your BIM model in unity have a read through our API Docs.