pyRevit Routes (HTTP API)
Control Revit from a web application
Let’s say we want to create a web application that would display a list of doors in a model. The web application would be split into two parts.
- Font-end: the part that runs in the browser and acts as the user interface, and
- Back-end: the part that the front-end contacts to send and receive data
While you are free to select whatever toolchain and GUI framework (React, Vue.js, etc) you are comfortable with for the front-end, the challenge has always been on how to create a back-end that has access to Revit contexts and can query or modify Revit documents. What we really needed is to run a HTTP web server over a running Revit instance and manage the HTTP calls in a way that would be executed in Revit context.
The new Routes python module, is an HTTP micro-framework to create web APIs running over Revit instances. This means that you can create functionality that could be triggerd from remote. This framework provides the necessary mechanism to create a back-end that has access to Revit context.
Also worth looking at Radu Gidei’s DynaServer implemented for Dynamo.