C# Chatbot using Revit API
There are many advantages to using chatbots. With chatbots you get to collect valuable data and metrics about each user and optimizing their experience. The quick automated response that the chatbot generates helps the user save time and get a timely response to all their queries and questions.
There are two types of chatbots:
Fixed and AI powered
Though both have their advantages, AI powered chatbots offer a higher range of features and data handling capabilities. Fixed chatbots however are programs with fixed information, even with the limited help they offer, they are used to solve repetitive questions and are not as popular since they do not understand human behavior.
Below I cover how to build a fixed chatbot inside of Revit which tries to provide answers using the Revit API. This article is a basis of a follow-up AI powered chatbot article inside of Revit. I have implemented a WPF (Windows Presentation Foundation) form in Revit as shown below in figure 1.1
figure 1.1 - UI
I've added the following window properties ,a textbox for the user input and a textbox to display the user-chatbot interaction. An event handler click button was also added as shown below in figure 1.2
figure 1.2 - UI.xaml
Using the Revit API to create Chatbot Plugin:
To invoke the chatbot application inside of Revit a manifest file needs to be created with the assembly path which is the full path to the add-in assembly file as shown in figure 1.3. This is required for all external Applications.
figure 1.3 - Chatbot.addin
In order to access the chatbot UI a ribbon tab inside of Revit named chatbot was created with a panel button as shown in figure 1.4
figure 1.4 - Ribbon Tab
Using the Revit API and Revit API UI dll as references an AEC-DEV panel needs to be created with some of the code as shown below in figure 1.5
figure 1.5 - Ribbon Panel
This chatbot is used as a query tool allowing the user to query a fixed number of information which is tedious and time consuming.
This Chatbot is fixed to perform only a few commands as shown in the video below, we can see as the chatbot attempts to duplicate multiple views based on the user input provided. The bot first filters for all the views in the active Revit Project and this is a very useful feature since the duplication of views in Revit is a tedious task. Despite it's limitations the chatbot can still automate these time-consuming tasks.
figure 1.5 - View Filter
This article sums the basis of a chatbot, following this is an article featuring how to set up a WPF plugin in Revit and adding the External Event Chatbot commands.
can this help the designer look for building codes outside the model?
Very excited about this Musa 😁