BIM 42

Building a Forge Web Viewer

Web-based “BIM” solutions are the last big trend, and Autodesk is among the most advanced player in this area with their API offering called Forge.

Autodesk Forge is a product from Autodesk that don’t come with a user interface. Instead, it is designed to be used through other software, and especially web-based solutions. Autodesk Forge is also the technology behind most of the web-based product of Autodesk, like BIM 360 Team, Docs or the A360 Online File Viewer.

The community around these products is growing, and new resources and samples are published on an almost daily basis.

Among them, Augusto Gonzales recently wrote a comprehensive tutorial to build a small web viewer using Autodesk Forge and ASP.NET. Being more of a .NET programmer, I took on this opportunity to learn more about this new product and build my own web-based Forge viewer.

I start by creating an ASP.NET Core MVC Web Application with this tutorial. ASP.NET Core being a web framework developed by Microsoft, you can use your C# skills to “easily” build web application.

I follow the detailed explanations from Augusto Gonzales to send my model to the Autodesk server for conversion, get an GUID back and use it to display my model in the Forge viewer. The explication on the blog are straightforward, and I won’t delve into it. I just had to made some few changes since I am using a different version of the ASP.NET Core framework.

Using technologies from Microsoft, it is easy to publish my application on Azure, the Microsoft cloud hosting solution.

I called the end-result Termite, and it is available here.

The-Termite-Web-Viewer The Termite Web Viewer

By default, you see a model of my neighborhood from my last post, but you can also upload your own files. A word of caution, uploading and translating a large model can take quite some time, do not close the windows until your model is displayed on the screen.

I also add some features to the viewer. You can lock the rotation of the view by clicking on the lock icon. I also put in place a very basic section tool. To use the section, click on “Add a section” and select a face in the model to create your section.

Viewer-Extensions

Viewer Extensions

These features are built as extension of the Autodesk Forge Viewer, are written in JavaScript and run in the browser of the end user.

The source code is available on GitHub. Seasoned web developer will probably find a lot to correct in my application, but I hope to improve with practice

I still have a lot to learn in this area, so you might expect some other web app in the next few weeks.

This blog is maintained by Simon Moreau