VolocyNazad.Revit.Events
2025.0.9
dotnet add package VolocyNazad.Revit.Events --version 2025.0.9
NuGet\Install-Package VolocyNazad.Revit.Events -Version 2025.0.9
<PackageReference Include="VolocyNazad.Revit.Events" Version="2025.0.9" />
<PackageVersion Include="VolocyNazad.Revit.Events" Version="2025.0.9" />
<PackageReference Include="VolocyNazad.Revit.Events" />
paket add VolocyNazad.Revit.Events --version 2025.0.9
#r "nuget: VolocyNazad.Revit.Events, 2025.0.9"
#:package VolocyNazad.Revit.Events@2025.0.9
#addin nuget:?package=VolocyNazad.Revit.Events&version=2025.0.9
#tool nuget:?package=VolocyNazad.Revit.Events&version=2025.0.9
Revit.Events
Service implementation for raising external events in the Revit API.
Revit.Events is a set of services with support for DI containerization, for queuing operations initiated outside the Revit API context and executing them inside the Revit API context.
More about how the mechanism works:
Installation
dotnet add package VolocyNazad.Revit.Events
The package is built per Revit version: the assembly is tied to a specific Revit version — choose the package version matching your Revit API version.
Features
IExternalEvent— synchronously queues an action on Revit's external event queue, returning anExternalEventRequestimmediately.IAsyncExternalEvent— the async version: returns aTaskthat completes once the action has run inside Revit (including with an error, if the action threw an exception).ExternalEventOptions.AllowDirectInvocation— if the call is already happening inside the Revit API context, the action runs immediately, without going through Revit's external event queue.
DI Registration
using Revit.Events.DI;
services.AddEvents();
Registers IExternalEvent and IAsyncExternalEvent as singleton services.
Usage
Synchronous
public class MyCommand
{
private readonly IExternalEvent _externalEvent;
public MyCommand(IExternalEvent externalEvent) => _externalEvent = externalEvent;
public void Run()
{
_externalEvent.Raise(uiApplication =>
{
// code that requires the Revit API context
});
}
}
Asynchronous
public class MyCommand
{
private readonly IAsyncExternalEvent _asyncExternalEvent;
public MyCommand(IAsyncExternalEvent asyncExternalEvent) => _asyncExternalEvent = asyncExternalEvent;
public async Task RunAsync()
{
await _asyncExternalEvent.Raise(uiApplication =>
{
// code that requires the Revit API context
});
}
}
AllowDirectInvocation
_externalEvent.Raise(uiApplication =>
{
// ...
}, ExternalEventOptions.AllowDirectInvocation);
If the code is already running inside the Revit API context (for example, called from another external event), the action executes immediately — without being queued and waiting for Revit's next "tick".
Supported Revit Versions
Revit 2021.1.9 and 2023.0.0 use net48; Revit 2025.0.0 uses net8.0-windows.
Development
The matrix of Revit versions is defined by the build configurations (Debug_<year>.<...> / Release_<year>.<...>) in src/Revit.Events/Revit.Events.csproj and Toolkit.Revit.Events.slnx. The package version is computed automatically from git tags via MinVer, tied to the Revit year.
Tests live in tests/Revit.Events.Tests. Part of the logic (working with real Revit-typed objects) cannot be tested outside of the Revit process — such tests are marked [Fact(Skip = "...")].
dotnet build --configuration "Release_2025.0.0"
dotnet test --configuration "Release_2025.0.0"
Changelog
See CHANGELOG.md.
License
Development documentation
Contributing
CONTRIBUTING.md before submitting changes.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
-
net8.0-windows7.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Revit_All_Main_Versions_API_x64 (>= 2025.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on VolocyNazad.Revit.Events:
| Package | Downloads |
|---|---|
|
VolocyNazad.Revit.MediatR
Revit MediatR. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2025.0.9 | 107 | 9/21/2026 |
| 2025.0.8 | 129 | 9/6/2026 |
| 2025.0.7 | 138 | 8/13/2026 |
| 2025.0.6 | 138 | 6/11/2026 |
| 2023.0.9 | 98 | 9/21/2026 |
| 2023.0.8 | 121 | 9/6/2026 |
| 2023.0.7 | 123 | 8/13/2026 |
| 2023.0.6 | 130 | 6/11/2026 |
| 2021.0.9 | 91 | 9/21/2026 |
| 2021.0.8 | 120 | 9/6/2026 |
| 2021.0.7 | 124 | 8/13/2026 |
| 2021.0.6 | 133 | 6/11/2026 |