Repository navigation
[Context] Redraw the Revit interface after the API upgrades a family from an earlier version - #137
Merged
Merged
Conversation
… after a file upgrade
… compatibility scope
…nounce it in the changelog
…ing-resumption-scope # Conflicts: # CHANGELOG.md
…-scope' into context/136-rendering-resumption-scope
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.
Summary of the Pull Request
What is this about:
Redraws the Revit ribbon, the dockable panes, and the add-in windows after the API upgrades a family from an earlier Revit version.
Description:
What changed
RevitContext.BeginModalLoopCompatibilityScope()returns a scope that posts the WPF frame notificationMilChannelNotifyto theMediaContextNotificationWindowof the current thread on dispose.FindWindowExby its title and owner thread, and caches the handle per thread.NativeMethods.txt.Where to look
MediaContextNotificationWindowand the registered messageMilChannelNotify. Both have the same values in .NET Framework and .NET. If WPF renames them, the scope posts nothing, and the interface behaves as without the scope.Begin...Scope()methods: it changes no state. A nested scope and a second dispose post a repeated notification, and WPF reads an empty render channel and returns.PInvoke009. CsWin32 recommendsSystem.Memoryon .NET Framework for Span overloads, and the five functions take no Span. The package takes no new dependency.PrintWindow. Windows composes no frame for a window entirely outside the screen, so the 40-pixel window shows one column of pixels at the left edge of the virtual screen during the test.How verified
Release.R20,Release.R21,Release.R24,Release.R26, andRelease.R27, zero errors and no new warnings.RevitContextTestson Revit 2025 and 2027: 14 passed. On Revit 2026: 15 passed, with the test for a thread without WPF.BeginModalLoopCompatibilityScope_TemplateOfThePreviousVersion_WindowDrawsTheNextFramecreates a family from the installed template of the previous Revit inside the scope. With the post removed, it fails on Revit 2026: the window shows the color of the moment of the upgrade.Quality Checklist