Repository navigation
Conversation
In a file without its own class schema whose partition streams frame, the block parser reads the records of the project's own block as the framing lists them instead of scanning the chunks of those streams. Blocks of loaded family documents are no longer read as project elements. The geometry of a record that runs into the next segment or is over the size limit of the scan is not decoded, as the scan never reached it. Refs #48.
This branch has not been deployed
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.
Refs #48
In a file without its own class schema (Revit 2020 and 2022) whose partition streams are read by their framing, the block reader now reads the records of the project's own block as the framing lists them, in their current copy, instead of scanning the stream for anything that looks like a block.
What changes
BlockParser.ParseBlockis the body of the scan loop, so a framed record and a scanned block go through the same code.RvtFileReader.ParseFramedBlocksfeeds every framed record but the channel-101 headers (owner 1 touint.MaxValue, at least 18 bytes) to it, a record that runs into the next segment included (PartitionFraming.Framed.Bytescopies it out of its segments). The chunks of the partition streams are then not scanned; every other chunk is scanned as before.BlockParser.MaxBlockSize(1,000,000) bytes is not decoded, as the scan never reached it. On the largest test file ten such geometry records of 0.7 to 0.9 MB took 28 to 180 s each in the geometry decoder and changed nothing in the output.Measured
26 project files, export of this branch against the commit it starts from (the head of #190):
RvtDocument, one test file (59,201 entries before), checked against the elements Revit 2022 returns for each id: the 8,135 elements Revit returns are unchanged (category, type, name, parameters, references). Of the entries Revit does not return, 49 without a category are gone and 50,738 change, mostly by losing parameters (3,737,513 parameters in all before, 3,161,540 now); 16,373 change their name. Two snapshot tests inApiTests.cscount names over that list and now include two such entries (ids 172544 and 265364), so their expected values are updated.Not covered
Verification
OwnElementClassTests: a project record across two segments is read and a family block is not; the geometry of a crossing record and of a record over the size limit is not queued.ReferenceApiTestsandOwnElementClassTestspass (43 of 43).