Introducing a Revit API Framework!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys, I have been programming Revit API for at least 8 years now and always tried to find ways to make my work easier, I have always wanted to have data-rich apps that communicate with the cloud, and with the introduction of Autodesk Forge a few years back, I had the need to share even more code between various projects and assemblies.
Today, I'm thrilled to introduce the Onbox Framework, a free and open-source (MIT) to help us build cross-platform Revit Apps in a similar fashion to Angular and ASP.Net Core. It is designed to make it easier to create a jump between these environments without workflow disruptions. It introduces several features out-of-the-box, like dependency injection (IOC Container), state management, asynchronous Revit calls, a component-based MVC library made on top of WPF, and much more!
Here is the reference of the libraries that compose the framework and their NuGet packages, notice that most of the libraries are targeting .Net Standard to be used both on .NetFramework and .Net Core:
Onbox.Abstractions | Interfaces of all generic usage on the framework | .Net Standard 2.0 |
Onbox.Core | Core implementations for all generic services | .Net Standard 2.0 |
Onbox.Di | IOC container system | .Net Standard 2.0 |
Onbox.Mvc.Abstractions | Interfaces for interacting with Views | .Net Standard 2.0 |
Onbox.Mvc | Implementation of WPF MVC Views and Components | .Net Framework 4.7.2 |
Onbox.Mvc.Revit.Abstractions | Interfaces for interacting with Revit and Views | .Net Standard 2.0 |
Onbox.Mvc.Revit | Implementation of WPF MVC specific to Revit | .Net Framework 4.7.2 |
Onbox.Revit.Abstractions | Interfaces for interacting with Revit | .Net Standard 2.0 |
Onbox.Revit | Revit External Applications and Commands | .Net Framework 4.7.2 |
Onbox.Store | State management for Revit MVC / WPF | .Net Standard 2.0 |
We have built parts of several applications using some of these libraries, our current working project, Shedmate app is the one that relies on it the most. I would say parts of it because only some libraries existed when we started coding the app. Shedmate is a web-based 3d configurator that needs to process the same data models in different places: Revit, our ASPNet Cloud server, and our front end Angular app. The cool thing here is that we can share services between the Revit and ASP and even run a script to generate our data models in typescript for Angular!
Simplicity:
None of the features that Onbox provides out of the box are really trying to be the best ones in the industry. The framework is made with simplicity in mind, we tried to simplify the implementations as much as we could, even when we wanted to provide more functionality, we tried to make it easy to consume simpler versions of the APIs.
Modularity:
The framework aims for modularity, so the idea here is that you can introduce new functionality by yourself. Our libraries, e.g. Container, Mapper, State Management, Async are tiny and are not trying to solve every single problem or implement every single feature, also they can always be replaced by more mature ones out there.
Flexible:
The framework also aims to be flexible, if you have an existing Revit plugin and want to give Onbox a try, you would just swap the implementation for your ExternalApplication and then for the ExternalCommand(s) you want the container to be injected on. You are good to go!
Testability:
With the loosely coupled architecture that the framework helps you to build, you can then use any testing frameworks like Dynamo's Revit Tester Framework or Geberit's Revit Test Runner. We are even using Design Automation on Forge to unit test our Revit Apps, that way, everything can be integrated into a CI/CD pipeline.
Documentation:
Documentation is in its early stages, (yeah I know.. documentation is important). We have a simple Getting Started Guide here and the complete API documentation here. The written tutorials explaining the main concepts are still of the libraries are still in the works, and we will be doing constant updates on it from now on. (now that AU recordings are finally over).
Usage and Collaboration:
Everyone is welcome to use it and collaborate! Being MIT licensed, you can take any parts of the framework and modify it to your usage, this is simple, because the libraries are tiny. The same thing for eventual bugs, you can step in and fix them yourself or log an issue on Github. We would appreciate any code pull requests, contributions to the documentation, and publications you make for it. The idea is to have a mature Framework so everyone can collect the benefits.
AU 2020:
I'm teaching two classes on AU this year, one is an industry talk (Lessons Learned in Three Years of Forge Dev - SD468705) that talks about our 3 years of Experience using Forge, the issues and problems we faced, and some tips and tricks for you do not waste so much time as we did try to solve them, during the class we explain the benefits of using a loosely coupled architecture for building Revit applications. The other one is a lab (The Cross-Platform Revit - SD468797-L). This one goes through an overview process of building multi-platform Revit apps, we show how to share base code for Revit plugins, Dynamo (Zero touch) nodes, and Design Automation for Revit, and we use the framework do help us to do so. If you are interested in the framework, please attend these classes next month on AU. 😁