Scotec.Revit
2027.4.0-dev.4
dotnet add package Scotec.Revit --version 2027.4.0-dev.4
NuGet\Install-Package Scotec.Revit -Version 2027.4.0-dev.4
<PackageReference Include="Scotec.Revit" Version="2027.4.0-dev.4" />
<PackageVersion Include="Scotec.Revit" Version="2027.4.0-dev.4" />
<PackageReference Include="Scotec.Revit" />
paket add Scotec.Revit --version 2027.4.0-dev.4
#r "nuget: Scotec.Revit, 2027.4.0-dev.4"
#:package Scotec.Revit@2027.4.0-dev.4
#addin nuget:?package=Scotec.Revit&version=2027.4.0-dev.4&prerelease
#tool nuget:?package=Scotec.Revit&version=2027.4.0-dev.4&prerelease
Scotec.Revit
Core library for building robust, testable, and maintainable Autodesk Revit add-ins with .NET.
Overview
Scotec.Revit provides the foundational abstractions and infrastructure for Revit add-in development. It simplifies command execution, application lifecycle management, and background-to-Revit-context communication, while promoting clean architecture through dependency injection and service separation.
Key Features
- RevitCommand — Base class for
IExternalCommandwith built-in transaction management, a per-execution DI scope, and structured failure handling. Supports transaction modes:None,Transaction,TransactionGroup,TransactionWithRollback,TransactionGroupWithRollback, andReadOnly. - RevitApp / RevitAppBase / RevitDbApp — Base classes for
IExternalApplicationandIExternalDBApplicationthat wire up anIHost(Microsoft.Extensions.Hosting) for the add-in lifecycle, enabling full IoC container support via Autofac. - RevitTask — Enables safe execution of Revit API operations from any thread or async context
using the
IExternalEventHandlermechanism. Supports both result-returning and void tasks, with optional DI parameter resolution. - RevitEventHandler — Generic base class for subscribing to Revit application events with a per-invocation DI scope. Pre-built concrete handler bases are provided for all common document, application, and UI events.
- RevitCommandAvailability — Base class for
IExternalCommandAvailabilitywith DI scope per availability check, enabling ribbon button state to be driven by injected services. - RevitHostBuilder — Configures the hosted application and registers Revit-specific services.
- RevitUpdater — Base support for
IUpdater(dynamic model update) implementations. - RevitSpatialContainmentResolver — Resolves spatial containment (rooms, spaces, zones).
- RevitLinkGraphBuilder — Builds a graph of Revit link relationships for traversal and analysis.
- RevitBasicFileInfo — Reads Revit file metadata without opening the document.
One Add-in per Assembly Load Context
Each RevitAppBase-derived application must run in its own AssemblyLoadContext. The framework
stores the root DI service provider in a static field scoped to the load context, which means only
one application instance is supported per context. Attempting to load a second application into the
same context would silently overwrite the service provider, causing unpredictable behavior.
In practice this is not a restriction: every properly isolated add-in already runs in its own context. Use Scotec.Revit.Isolation to generate the required load context infrastructure automatically at compile time.
Getting Started
Install the NuGet package:
dotnet add package Scotec.Revit
Your project must target net8.0-windows or net10.0-windows.
Related Packages
Documentation
License
MIT License — https://licenses.nuget.org/MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- Autofac.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.Hosting (>= 10.0.2)
- OpenMcdf (>= 3.1.4)
- Scotec.Extensions.Linq (>= 1.1.1)
- Scotec.Extensions.Utilities (>= 1.1.1)
- Scotec.Revit.Isolation (>= 2027.4.0-dev.4)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Scotec.Revit:
| Package | Downloads |
|---|---|
|
Scotec.Revit.Wpf
Adds WPF support to Scotec.Revit. |
|
|
Scotec.Revit.Ui
Adds UI support to Scotec.Revit. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2027.4.0-dev.4 | 62 | 6/20/2026 |
| 2027.3.4 | 146 | 6/15/2026 |
| 2027.3.3 | 110 | 6/10/2026 |
| 2026.4.0-dev.4 | 62 | 6/20/2026 |
| 2026.3.4 | 112 | 6/15/2026 |
| 2026.3.3 | 106 | 6/10/2026 |
| 2025.4.0-dev.4 | 71 | 6/20/2026 |
| 2025.3.4 | 126 | 6/15/2026 |
| 2025.3.3 | 109 | 6/10/2026 |