RevitServerNet 1.4.0
dotnet add package RevitServerNet --version 1.4.0
NuGet\Install-Package RevitServerNet -Version 1.4.0
<PackageReference Include="RevitServerNet" Version="1.4.0" />
<PackageVersion Include="RevitServerNet" Version="1.4.0" />
<PackageReference Include="RevitServerNet" />
paket add RevitServerNet --version 1.4.0
#r "nuget: RevitServerNet, 1.4.0"
#:package RevitServerNet@1.4.0
#addin nuget:?package=RevitServerNet&version=1.4.0
#tool nuget:?package=RevitServerNet&version=1.4.0
<p align="center"> <img src="https://raw.githubusercontent.com/mahach666/RevitServerNet/master/docs/images/revitservernet-banner.png" alt="RevitServerNet" width="640"> </p>
A .NET library for working with Revit Server REST API. Provides easy access to Revit Server operations including folder management, project operations, locking, and history tracking.
Documentation: https://mahach666.github.io/RevitServerNet/
Features
- Server Management: Get server information and status
- Folder Operations: Create, delete, and manage folders on Revit Server
- Project Information: Read a model's project information parameters
- Locking: Lock and unlock models and folders, cancel in-progress locks, list or delete descendent locks, and query server-wide and per-model locks
- History Tracking: Access project history and version information
- Copy / Move: Copy and move items on the server (
CopyItemAsync,MoveItemAsync) - Recursive traversal:
WalkAsync,GetAllModelsRecursiveAsync,GetAllFoldersRecursiveAsync - Admin UI API:
RevitServerUiApiforRevitServerAdmin{YEAR}/api/...(model details, lock data, histories, tree, rename/delete, copy/move, lock/unlock, create folder) - Direct Export: Export Revit Server models to RVT files over the Revit Server ModelService (net.tcp), without RevitServerTool.exe (net48/net6/net8)
- RevitServerTool wrapper:
RevitServerToolClient.CreateLocalModelAsyncfor exporting through RevitServerTool.exe - Multi-Version Support: REST and Admin UI clients for Revit Server 2012 and later; direct export for any server year that exposes
/ModelService{year}/, with one bundled set of Autodesk client assemblies (verified live against Revit Server 2022-2025) - Async Operations: All API calls are asynchronous for better performance
Installation
Via Package Manager Console:
Install-Package RevitServerNet
Or via NuGet Package Manager:
RevitServerNet
Or via .NET CLI:
dotnet add package RevitServerNet
Quick Start
using RevitServerNet;
using RevitServerNet.Extensions; // GetServerInfoAsync, ListFoldersAsync, GetFolderContentsAsync are extension methods
// Initialize API client
// serverVersion defaults to "2019": set it to your Revit Server year
var api = new RevitServerApi("your-server-host", "your-username", serverVersion: "2024");
// Get server information
var serverInfo = await api.GetServerInfoAsync();
// List subfolders of a folder (List<FolderInfo>, Path is filled in)
var folders = await api.ListFoldersAsync("|path|to|folder");
// Or everything in the folder (Folders, Models, Files)
var contents = await api.GetFolderContentsAsync("|path|to|folder");
Supported versions
REST API and Admin UI API: Revit Server 2012 and later. Direct export: any server year that exposes net.tcp://{host}/ModelService{year}/ModelService.svc/, verified live on Revit Server 2022 to 2025. The package targets .NET Framework 4.8, .NET 6 and .NET 8; the direct export needs Windows. Details, requirements and the exact limits: Versions and compatibility.
Documentation
- Getting started
- REST API:
RevitServerApiand the extension methods - Admin UI API:
RevitServerUiApi - Direct export: how it works, locks,
CreateLocal, cancellation, bundled assemblies, timeouts - RevitServerTool wrapper
- Error handling
- Versions and compatibility
- Testing: unit, wire and live tests
- API reference
- DeepWiki: an automatically generated overview of the repository
- Changelog
Build and test
dotnet build RevitServerNet.sln -c Release
dotnet test RevitServerNet.sln -c Release
The tests that need a live Revit Server are skipped unless the RSN_TEST_RS_* environment variables are set; see Testing. Building needs Windows (net48 and the direct export).
Contributing
Contributions are welcome. See CONTRIBUTING.md.
Security
Report vulnerabilities privately, see SECURITY.md.
Support
If you encounter any issues or have questions, please open an issue at https://github.com/mahach666/RevitServerNet/issues.
License
This project is licensed under the MIT License - see the LICENSE file for details.
RevitServerNet is not affiliated with, endorsed by or sponsored by Autodesk. Autodesk, Revit and Revit Server are trademarks of Autodesk, Inc. The package bundles unmodified Autodesk Revit Server client assemblies (the Revit 2024 set).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Newtonsoft.Json (>= 13.0.3)
- System.Security.Permissions (>= 9.0.9)
-
net6.0
- Newtonsoft.Json (>= 13.0.3)
- System.Security.Permissions (>= 9.0.9)
- System.ServiceModel.NetTcp (>= 4.9.0)
- System.ServiceModel.Primitives (>= 4.9.0)
-
net8.0
- Newtonsoft.Json (>= 13.0.3)
- System.Security.Permissions (>= 9.0.9)
- System.ServiceModel.NetTcp (>= 4.9.0)
- System.ServiceModel.Primitives (>= 4.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixes checked against live Revit Server 2022 and 2025. History Version/Size, ModelInfo.Size and ServerInfo.Roles map the real server fields (were always 0/null). Lock queries use endpoints that exist (IsModelLockedAsync was always false). RenameFolderAsync with an empty name no longer deletes the folder; DeleteFolderAsync really deletes; Copy/Move/CancelLock/DeleteDescendentLocks report success correctly; 500-after-success of some names is verified. No sync-over-async deadlock (ConfigureAwait(false)); non-ASCII user names are sent percent-encoded; RevitServerApi.Timeout and CancellationToken overloads. RevitServerUiApi throws on HTTP 200 error descriptors and refuses an empty new name. Export checks the destination before downloading, accepts paths with extra separators, and cancels promptly while connecting. RevitServerToolResult.Success is false on an ERROR: line. Several error behaviours changed (exists checks, WalkAsync, lock queries throw instead of returning false); see CHANGES.md.