Repository navigation
Keep the inserted fields of an object when the next one is cut out - #356
Merged
Merged
Conversation
The rewrite into the 2022 layout inserts the fields a 2022 class adds at the end of an object where the next object starts. When that next object had no 2022 class, every edit from its start on was removed before cutting it out, so those inserts were lost and the data after them moved. Reading a cut object adds no edits, so the removal is not needed.
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.
What changes and why
The rewrite of a Revit 2023 or later file into the 2022 layout lost data. It inserts the fields the 2022 class adds
at the end of an object where the next object starts. When that next object has no Revit 2022 class,
R22Transcoder.Payloadremoved every edit from its start on before cutting it out, so those inserts were removed tooand everything after them moved by their length.
Reading a cut object adds no edits, so the removal could only reach inserts that belong to the object before it. The
line is removed.
How it was checked
New test
Payload_KeepsTheFieldsAddedAtTheEndOfAnObjectBeforeOneItCuts: it fails onmainand passes with thechange.
dotnet build RvtIO.slnx -c Releasesucceeds. The warnings come from building the test project and its packages;the same warnings are on
main, and this change adds none.Tests in Release with
RVTIO_TEST_FILESset: net10.0 12403 passed, 0 failed, 366 skipped; net8.0 12399 passed,0 failed, 366 skipped.
IFC, compact and full JSON, Scene and the report written by
tools/benchmark-export.pyon a local set of samplefiles are byte-identical to
main. Why the restored bytes do not change any of these outputs has not been traced.A temporary counter that is not part of this change shows that the removed line did drop non-empty inserts in real
files, before cut objects of the classes
GPoint,StructAttachInfo,RebarInstCacheandAnalyticalSingleUpstreamNodeData, and that reading a cut object never added an edit. Where the damaged payload isa
CoordinateSystemDisplayElemor aMEPAnalyticalDistributionNode, it reads exactly with the 2022 class tableonly with this change. For
FamilyInstanceandRebarpayloads that check stops before the restored bytes, at thesame place with and without the change, so it says nothing about them.
dotnet build RvtIO.slnx -c Releasehas no warningsdotnet testpassesExports of the same files before and after are identical, or the differences are listed and intended
No Revit models, customer data or vendor files are added