Update Nice3point.Revit.Extensions - #79
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the centrally managed Revit-dependent Nice3point.Revit.Extensions NuGet package versions across supported Revit year configurations, keeping the toolkit’s dependency matrix in sync with the latest patch releases.
Changes:
- Bumps
Nice3point.Revit.Extensionsfor Revit 2021–2027 to the next patch version (*.x.2→*.x.3).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2021.5.2→2021.5.32022.5.2→2022.5.32023.5.2→2023.5.32024.3.2→2024.3.32025.2.2→2025.2.32026.1.2→2026.1.32027.0.2→2027.0.3Release Notes
Nice3point/RevitExtensions (Nice3point.Revit.Extensions)
v2027.0.3Compare Source
This update focuses on making Revit collections and maps enumerable the way the rest of .NET is.
The Revit API mirrors the native C++ containers. A collection stops its contract at the non-generic
IEnumerable.A
foreachover it yieldsobjectand every LINQ query opens with a cast.A map goes further and keeps the key of the current entry on the concrete iterator instead of in the enumeration, so a
foreachnever sees the key at all.Reading the keys means a hand-written loop over
ForwardIterator(), and that iterator holds a native handle until it is disposed.Iterating a map used to take a loop:
Now the key travels with the value, and the iterator is disposed for you:
Looking up a value used to take two calls, and the indexer is reachable only through
get_Item:Now it takes one:
Collections used to name their element type at every call site:
Now the element type comes from the collection:
New Extensions
Maps
Available on
DefinitionBindingMapandBindingMap,ParameterMap,CategoryNameMap, andCategories:map.EnumerateEntries()map.EnumerateKeys()map.EnumerateValues()map.TryGetValue(key, out value)Collections
Available on every array and every set holding elements of a single type, 51 of them:
curveArray.EnumerateValues()faceArray.EnumerateValues()elementArray.EnumerateValues()categorySet.EnumerateValues()parameterSet.EnumerateValues()viewSet.EnumerateValues()Performance
Reading a collection the short way is also the fast way.
EnumerateValues()is not a wrapper overCast<T>().An array exposes its size and an indexed accessor, the enumeration reads every element by its index and spends one interop call per element.
A
Cast<T>()over the same array walks a native iterator and spends two.A set exposes no index, the enumeration walks the enumerator itself and drops the LINQ layer above it.
A map keeps the key of the current entry on its iterator and the value on
Current, so building a pair costs two interop calls.EnumerateKeys()andEnumerateValues()read only the side you ask for and pay for one.Measured on Revit 2027 over an array of 1000 curves, a set of 600 categories, and the parameter map of a level:
array.EnumerateValues()array.Cast<Curve>()set.EnumerateValues()set.Cast<Category>()map.EnumerateKeys()map.EnumerateValues()The worst case is a set, 5% faster for the same allocation.
The best case is a map key enumeration, 30% faster and 35% fewer bytes.
The benchmark and its results in EnumerationBenchmark.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Renovate Bot.