Bowerbird accelerates C# tool and plug-in development by dynamically compiling C# source files.
The current release of Bowerbird is for Revit 2025 only.
When Bowerbird starts up it scans a directory for C# source files (with the extension .cs
),
and attempts to compile them into a single assembly.
For Revit the source files can be found at:
%localappdata%\Ara 3D\Bowerbird for Revit 2025\Scripts
.
The assembly is then loaded into memory and scanned for public classes which implement the
INamedCommand
interface.
public interface INamedCommand : ICommand
{
string Name { get; }
void NotifyCanExecuteChanged();
}
public interface ICommand
{
event EventHandler? CanExecuteChanged;
bool CanExecute(object? parameter);
void Execute(object? parameter);
}
Each command is listed in the main interface of the application. Double clicking on the interface will launch it.
For Revit the "argument" passed to the Execute function will be an instance of UIApplication
.
Editing and saving any file in the directory will trigger a recompilation of all files, and reloading of the commands.
For convenience you can derive a command from a class called NamedCommand
which provides
default implementations of most functions.
/// <summary>
/// Displays the current active document in a window
/// </summary>
public class CurrentDocument : NamedCommand
{
public override string Name => "Current Open Document";
public override void Execute(object arg)
{
var app = (UIApplication)arg;
var doc = app.ActiveUIDocument?.Document;
if (doc == null)
{
MessageBox.Show("No document open");
}
else
{
MessageBox.Show($"Open document: {doc.PathName}");
}
}
}
Previous versions of Bowerbird, had a dependency on the Ara3D module, but now a library called Ara3D.SDK is consumed as a nuget package.
After compilation a build-script called post-build.bat
is run. This copies an add-in file
Ara3D.Bowerbird.Revit2025.addin
to the folder %programdata%\Autodesk\Revit\Addins\2025
.
The depdendent DLLs are copied to the sub-folder Ara3D.Bowerbird
.
C# source files are copied into the folder %localappdata%\Ara 3D\Bowerbird for Revit 2025\Scripts\
.
The final installer is an Advanced Installer project.
There are several popular tools, particularly in the realm of 3D design software, which have an SDK with a C# API for developing plug-ins. Our current focus is Autodesk Revit.
Two main challenges with plug-in development are:
- A lot of overhead and boilerplate for creating new tools
- A slow development cycle of build, compile, copy, and restart host application.
Using separate languages for quick scripting and another for distributed plug-ins, fractures the community, creates a cognitive load for developers, and is a barrier for some developers.
By using a dynamic compilation library based on Roslyn one generic Bowerbird plug-in can host many other plug-ins which can be dynamically compiled and modified without restarting the host application. This means that we can quickly create new experiments, plug-ins, try out new ideas, or test hypotheses aboout our code.
We appreciate and welcome any feedback.
Please submit issues, suggestions, and questions via the issues tracker.