VolocyNazad.Revit.Sugar 2025.0.9

dotnet add package VolocyNazad.Revit.Sugar --version 2025.0.9
                    
NuGet\Install-Package VolocyNazad.Revit.Sugar -Version 2025.0.9
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VolocyNazad.Revit.Sugar" Version="2025.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VolocyNazad.Revit.Sugar" Version="2025.0.9" />
                    
Directory.Packages.props
<PackageReference Include="VolocyNazad.Revit.Sugar" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add VolocyNazad.Revit.Sugar --version 2025.0.9
                    
#r "nuget: VolocyNazad.Revit.Sugar, 2025.0.9"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package VolocyNazad.Revit.Sugar@2025.0.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=VolocyNazad.Revit.Sugar&version=2025.0.9
                    
Install as a Cake Addin
#tool nuget:?package=VolocyNazad.Revit.Sugar&version=2025.0.9
                    
Install as a Cake Tool

Revit.Sugar

Revit 2021.1.9, 2023, 2025 License: MIT VolocyNazad

Syntactic sugar for working with the Revit API: extension methods and small helpers with no DI and no state.

Revit.Sugar — a set of extension methods and static helpers that simplify common operations on Revit API objects: bounding box intersection, ElementId handling that doesn't depend on the API version, wrappers over FilteredElementCollector, ElementFilter factories, and a fluent IUpdater builder.

Features

  • BoundingBoxXYZ.Overlaps(other, tolerance) — a fast check for whether two bounding boxes' world bounds intersect (accounting for Transform), suitable as a broad-phase check before exact geometric intersection.
  • ElementId.IsCategory(category), .ToBuiltInCategory(), .Value() — hide the difference between IntegerValue (before Revit 2024) and Value (2024+).
  • Category.BuiltInCategory — the same for Category (versions before 2024 only).
  • FilteredElementCollector.OfClass<T>(), .WhereElementIs<T>() — generic wrappers over OfClass/WhereElementIsElementType/WhereElementIsNotElementType.
  • ElementFilterUtils.AllFilter(), .EmptyFilter(), .CategoryTypeFilter(doc, categoryType, inverse) — ready-made ElementFilter factories.
  • UpdaterBuilder — a fluent IUpdater builder that avoids implementing the interface by hand.

Installation

dotnet add package VolocyNazad.Revit.Sugar

Usage

using Revit.Sugar;

// Bounding box intersection
bool overlaps = boxA.Overlaps(boxB);

// ElementId, independent of the Revit version
BuiltInCategory category = elementId.ToBuiltInCategory();
bool isWalls = elementId.IsCategory(BuiltInCategory.OST_Walls);

// FilteredElementCollector
var walls = new FilteredElementCollector(doc).WhereElementIs<Wall>().ToElements();

// Filter factories
ElementFilter all = ElementFilterUtils.AllFilter();
ElementFilter modelCategories = ElementFilterUtils.CategoryTypeFilter(doc, CategoryType.Model);

// IUpdater without implementing the interface by hand
IUpdater updater = new UpdaterBuilder()
    .SetUpdaterId(new UpdaterId(addinId, new Guid("...")))
    .SetUpdaterName("My Updater")
    .SetChangePriority(ChangePriority.Structure)
    .SetAction(data => { /* ... */ })
    .Build();

Supported Revit versions

The package is built and tested for Revit 2021.1.9, 2023.0.0, and 2025.0.0. Revit 2021 and 2023 target net48; Revit 2025 targets net8.0-windows.

Requirements

  • .NET SDK 10.0.103+ (see global.json)
  • Revit API (the Revit_All_Main_Versions_API_x64 package)

License

MIT, see LICENSE.

Development documentation

Contributing

Read CONTRIBUTING.md before submitting changes.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.0.9 94 9/14/2026
2025.0.8 119 9/3/2026
2023.0.9 86 9/14/2026
2023.0.8 113 9/3/2026
2021.0.9 87 9/14/2026
2021.0.8 115 9/3/2026