Dotbim: Export A 3D Model From Grasshopper As .bim Format
![Export dotbim files from Grasshopper](https://www.structuralbasics.com/wp-content/uploads/2022/06/Exporting-dotbim-files-from-grasshopper.jpg)
As you might have seen – we use a lot of pictures of 3D models to explain structures in our blog articles.
Recently, I came across a new file format which makes it possible to include 3D models on your homepage with literally 0 code. This file format is called dotbim or .bim.
We have already included .bim 3D models in those articles:
In this How to guide we’ll show, step-by-step, how to install the dotbim Grasshopper plugin, build up a Grasshopper script that exports a Rhino/Grasshopper 3D model and how you can easily show the .bim file on your blog or homepage.
Here’s a quick summary of the steps we follow to export a .bim file
Not much more talk, let’s get started.
1. What is the .bim format?
In short: The .bim or dotbim format is a free and open-source file format that allows to visualize and transfer Geometry by triangulated meshes in an easy way.
You can read more about the details on its homepage here.
2. Installation of the dotbim Grasshopper plugin
To install the plugin head over to the Food4Rhino page of dotbimGH with this link. If you don’t have an account yet, create one and then click on download.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Download_dotbim_plugin_grasshopper-1024x735.png)
Extract the dotbim .zip file that you downloaded.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Extract_plugin_zip_file-1024x566.png)
Next, open up Rhino and Grasshopper. In Grasshopper click on the following buttons:
File >> Special Folders >> Components Folder (Folder opens up)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Open_Components_folder_Grasshopper-1024x641.png)
Move the folder inside the extracted folder (from .zip file) into the Components Folder.
Go into the folder dotbimGH.
Right click on the dotbimGH.gha >> Show more options (Windows 11) >> Properties >> Click Unblock
![](https://structuralbasics.com/wp-content/uploads/2022/08/Properties-.gha-file-1024x537.png)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Unblock-dotbimGH-plugin-1024x706.png)
Drag and drop the .gha file into the Grasshopper UI.
Now we are all set up with the plugin. As a confirmation we should see the dotbim button with its 2 panels and 8 components.
![](https://structuralbasics.com/wp-content/uploads/2022/08/dotbim-installed-1024x408.png)
3. The Grasshopper Script
The best way to explain things is by doing examples. So in this section we will model a cube and show how to export that cube to the .bim file format.
Later on we will export a model with a few more elements.
Let’s start by modeling the cube with the Box command.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Model-a-box-in-Rhino-1024x631.png)
As we learned earlier, the .bim file format uses meshes. Therefore we need to transform the cube in a mesh.
To do that type in the command line Mesh, click enter and select the cube.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Mesh-cube-in-Rhino-1024x635.png)
❗Another important thing to do before scripting in Grasshopper: The script will only generate a .bim file if the mesh is triangulated.
To triangulate the mesh – type in the command line TriangulateMesh and select the mesh.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Triangulate-mesh-1024x654.png)
The next step is to open up Grasshopper. Click on the Grasshopper icon or type in the command line Grasshopper.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Open-Grasshopper-1024x694.png)
The first thing we do in Grasshopper is to create an Element Set from the triangulated mesh with the component of the dotbim plugin.
dotbim >> Create >> Create Elements Set >> Click on GH Canvas
![](https://structuralbasics.com/wp-content/uploads/2022/08/Element-set-component-1024x495.png)
We can see that in order to create a Elements Set from meshes we need to provide the component with 6 inputs:
- Mesh
- Insert Planes
- Guids
- Types
- Colors
- Info
The quickest way to input the triangulated mesh is by right click on the mesh input of the component >> Set one Mesh >> Click triangulated mesh in Rhino
![](https://structuralbasics.com/wp-content/uploads/2022/08/Mesh-input-of-component-1024x547.png)
Do the following to satisfy the Insert Planes Input
Right click on Insert Planes on the Elements Set component >> Click on Set one Plane >> Select a point in Rhino which is the point of origin of the plane >> Select another point to define the first direction of the plane >> Select another point which defines the second direction of the plane
![](https://structuralbasics.com/wp-content/uploads/2022/08/Define-plane-of-Elements-Set-1024x450.png)
For the Guids input we use another component of the plugin.
dotbim >> Create >> Create Elements Set >> Click on GH Canvas >> Panel with any number >> Connect Panel with Create Guid component >> Connect Create Guid component with Guids input (Elements Set)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Create-component-Guids-in-GH-1024x611.png)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Create-panel-1024x564.png)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Guids-input-Elements-set-1024x331.png)
For the Types input we right click on the Types Input on the component >> click on Set Text >> Insert some text. In our example I wrote Concrete block, but this is up to you >> Click Commit changes
![](https://structuralbasics.com/wp-content/uploads/2022/08/Types-input-of-Elements-Set-component-1024x430.png)
For the colours input, double-click on the canvas and search for Colour Swatch >> pick a colour >> Connect the component with the Colours Input of the Elements Set component.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Colour-swatch-1024x697.png)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Colour-Input-1024x433.png)
Next, we need to add some information to the mesh(es). To do so we use the Create Info component and 2 panels. We use a number as input for the Keys and a string as input for the Values. It doesn’t matter what your string is but it could make sense to describe the mesh.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Create-Info-dotbim-1024x639.png)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Info-input-for-Elements-Sets-1024x878.png)
Now the export is the only thing that is left. To export the mesh into the .bim format we use the Create file component of the dotbim plugin.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Create-file-component-1024x729.png)
This component needs 3 Inputs in order to export a .bim file
- Elements Set
- Info
- Path
The first one, Elements Set, is the easiest. We just connect the Elements Set component with the Create file component.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Connect-elements-set-1024x496.png)
The Info Input is again the same as with the Info Input for the Elements Set. We use the Create Info component and 2 Panels and connect them to the Info Input of the Create file component.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Info-Input-for-Create-file-1024x470.png)
For the Path input, we use the component File Path
Double click on canvas >> Search for File Path >> Select File Path >> Right click on File Path component >> Click Select one existing file >> Choose the folder where you want to place the .bim file in and❗type in the name of the file with .bim at the end. In our case we call the file cube.bim❗>> Connect the File Path component with the Create file component
![](https://structuralbasics.com/wp-content/uploads/2022/08/File-path-1024x502.png)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Select-file-path-1024x524.png)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Save-.bim-file-1024x642.png)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Connect-file-path-to-Path-input-1024x456.png)
We can now also see that the color of the Create file component changed to grey which gives us an indication that the export worked. Now we go the cube.bim file in the folder that we chose.
![](https://structuralbasics.com/wp-content/uploads/2022/08/cube.bim-file-successfully-exported-1024x797.png)
4. Visualizing 3D models on your homepage without code
In this section we are going to learn how to employ a .bim 3D model in the web – on homepages or blogs.
We are using Github to store the file on a public server which can always be accessed. So head over there, create an account or log in your profile if you already have an account.
First thing we do is to create a new repository for all of our .bim files.
![](https://structuralbasics.com/wp-content/uploads/2022/08/New-repository-1024x421.png)
Give it a name, make it public and click on Create repository
![](https://structuralbasics.com/wp-content/uploads/2022/08/Repository-name-1024x617.png)
Go into that repository that you just created and click on Add file >> Upload files
![](https://structuralbasics.com/wp-content/uploads/2022/08/Add-file-to-repository-1024x435.png)
Drag and Drop the Cube.bim file into the Github canvas and click on Commit changes.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Upload-Cube-dotbim-file-1024x470.png)
![](https://structuralbasics.com/wp-content/uploads/2022/08/Commit-changes-1024x457.png)
Open that file on Github and click on Raw.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Raw-dotbim-file-1024x508.png)
Copy the Url of the Raw Cube.bim file.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Raw-url-1024x326.png)
Now let’s open the Online 3D Viewer and click on Open model from a url.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Open-model-from-a-url-1024x358.png)
Paste the raw cube.bim url from Github and click on OK.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Paste-Github-url.png)
Now we the Cube.bim 3D model is visualized in the online viewer💯
![](https://structuralbasics.com/wp-content/uploads/2022/08/3D-model-of-cube-1024x490.png)
The last step that is now missing is to generate the html code and insert that in your homepage or blog.
Click on Share model, copy the Embedding Code and insert the html code in your homepage.
![](https://structuralbasics.com/wp-content/uploads/2022/08/Embedding-Code-1024x632.png)
I am using Ghost editor for my blog, so if you use WordPress or another homepage editor it should work similarily.
In Ghost i click on HTML (insert a raw HTML card) and insert the copied embedding code.
![](https://structuralbasics.com/wp-content/uploads/2022/08/HTML-card-1024x373.png)
And now the 3D model is visible on that position on my blog post. It’s pretty cool, isn’t it?👍
5. More Information about dotbim
I think it’s a pretty interesting project, what do you think? If you want to learn more about it you can check out the articles and podcasts listed below:
- dotbim homepage (here)
- BIMvoice Youtube video: dotbim – Minimalist File Format for BIM with Wojciech Radaczyński (here)
- BIM Corner blog post: .bim – a new BIM file format (here)
Now, I would like to hear from you: What use cases do you see for this file format and its abilities? Let us know in the comments below📝.