Repository navigation
Description
Environment: NwcIO 0.18.0 from NuGet, net10.0, .NET SDK 10.0.202, Windows 11 x64.
var doc = NwcDocument.Open(path, NwcReaderOptions.Default); // Strict = false
var geo = NwcDocument.Open(path, new NwcReaderOptions { BuildSceneTree = false });I tested 11 real files from an industrial plant project. They come from several companies and were saved
from Navisworks. 2 files open fully, 3 open only with BuildSceneTree = false, and 6 do not open at all.
Strict = true gives the same errors.
The three errors
| Message | Where | |
|---|---|---|
| E1 | LcOaPartitionProps stream S at byte N: class 70, which this slot does not allow |
scene tree |
| E2 | LcOpNwdLogicalHierarchy at byte N: f64 alignment pad is not zero |
scene tree |
| E3 | LcOpNwdGeometry record N: class is not 94 or 95 at +4 |
geometry |
Files
| File | Type | Size | Format | Loader | Default options | BuildSceneTree = false |
|---|---|---|---|---|---|---|
| A | .nwd | 121 MB | 451 | – | E1, stream 0, byte 8 | opens, geometry only ¹ |
| B | .nwc | 154 MB | 448 | lcldifc |
E1, stream 0, byte 8 | opens, geometry only ¹ |
| C | .nwc | 43 MB | 448 | lcldifc |
E1, stream 0, byte 8 | opens, geometry only ² |
| D | .nwd | 298 MB | 448 | – | E2, byte 816 | E3, record 147 |
| E | .nwd | 56 MB | 448 | – | E1, stream 4, byte 3308644 | E3, record 599 |
| F | .nwd | 9.6 MB | 451 | – | E1, stream 0, byte 8 | E3, record 208 |
| G | .nwd | 9.5 MB | 448 | – | E3, record 12 | E3, record 12 |
| H | .nwd | 21 MB | 455 | – | E1, stream 0, byte 2764 | E3, record 465 |
| I | .nwd | 90 MB | 448 | – | E2, byte 540184 | E3, record 3 |
| OK-1 | .nwd | 77 MB | 448 | – | opens fully ³ | |
| OK-2 | .nwc | 0.5 MB | 448 | lcldstep |
opens fully |
¹ 111 956 meshes, 23.98 M triangles. No mesh is linked to a node.
² 10 130 meshes, 6.08 M triangles. No mesh is linked to a node.
³ 11.3 M triangles, 1 745 elements with IFC GlobalId and properties.
Format and Loader are FileInfo.FormatVersion and FileInfo.LoaderPlugin, read with every Read* option off
and BuildSceneTree = false. That read works for all 11 files.
Top frames of E1, E2, E3
InvalidDataException: LcOaPartitionProps stream 0 at byte 8: class 70, which this slot does not allow
at NwcIO.Internal.Parsing.LcObjectReader.ReadPointer(ReadOnlySpan`1 allowedClasses, Func`2 readBody, Boolean allowNull, Boolean allowBackReference)
at NwcIO.Internal.Parsing.HierarchyParser.Parser.ReadPartitionRoot()
at NwcIO.Internal.Parsing.HierarchyParser.PartitionRoots.Take()
at NwcIO.Internal.Parsing.HierarchyParser.Parser.ReadNode(Int32 classId)
InvalidDataException: LcOpNwdLogicalHierarchy at byte 816: f64 alignment pad is not zero
at NwcIO.Internal.Parsing.LcObjectReader.Align8(String what)
at NwcIO.Internal.Parsing.LcObjectReader.ReadDouble()
at NwcIO.Internal.Parsing.HierarchyParser.Parser.ReadMaterial()
at NwcIO.Internal.Parsing.HierarchyParser.Parser.ReadBody(Int32 classId)
InvalidDataException: LcOpNwdGeometry record 147: class is not 94 or 95 at +4
at NwcIO.Internal.Parsing.GeometrySegmentReader.ReadAsync(IReadOnlyList`1 chunks, LcRawStream toc, CancellationToken cancellationToken)
at NwcIO.Internal.Parsing.ModelGraphReader.ReadAsync(ModelSegments segments, NwcReaderOptions options, String rootName, NwcXRefTable xRefs, CancellationToken cancellationToken)
at NwcIO.NwcDocument.ParseContainer(NwcContainer container, NwcReaderOptions options, Boolean keepStreamCatalog, String fallbackName, IProgress`1 progress, CancellationToken cancellationToken)
The files are confidential client data, so I cannot attach them. I can run a diagnostic build or option on
them and send back output that has no model content: the stream catalog, the class ids and offsets of the
records that fail, or a hex dump of a record header.
Activity
mahach666 commentedon Dec 3, 2026
Hi @SergeyPriem, thanks for offering to run a test build. Could you rerun the same 11 files with the code from #292, using the same two settings as in your report? The PR adds support for class-70 IFC properties and class-96 point geometry. The material alignment error (E2) is still under investigation.
If you prefer the CLI, run this from a clone of NwcIO with .NET SDK 10.0.401 or a later .NET 10 SDK:
Please report which file labels now open with each setting and paste the exception messages for any remaining failures. For E3, the new message includes the actual class ID. For E2, the top few stack frames would help confirm where alignment fails. The models and JSON exports can stay local.
SergeyPriem commentedon Dec 4, 2026
Thank you. I ran all 11 files with the code of #292 (merge commit 83bc312), with the CLI as you wrote,
in both modes. .NET SDK 10.0.404, Windows 11 x64; the repository tests pass on this machine (net10.0).
I also ran a small test program against the same source to get the stack frames, and against main
(d29c91e, with #293). The failing files give the same result from a local copy (same SHA-256), so this
is not a sync or read problem on my side.
Result: 6 of 11 files open fully now (before: 2). A, B, C and F are fixed: the scene tree reads, and
every mesh is linked to a node. D, E, G, H and I still fail in both modes.
With
--no-tree, the geometry now fails on the same record numbers as E3 before (D 147, E 599, H 465,G 12, I 3). In D, E and H the record is class 96 and takes the new point path, but its terminator is not zero.
In G and I the record class is 105.
--no-treeLcOpNwdLogicalHierarchy at byte 816: f64 alignment pad is not zeroLcOpNwdGeometry record 147: point record terminator is not zero at +84LcOpNwdLogicalHierarchy at byte 16998232: string is not valid UTF-8LcOpNwdGeometry record 599: point record terminator is not zero at +60LcOpNwdGeometry record 12: class 105 is not 94, 95 or 96 at +4LcOaPartitionProps stream 0 at byte 510620: property value type 15 is unknownLcOpNwdGeometry record 465: point record terminator is not zero at +60LcOpNwdLogicalHierarchy at byte 540184: f64 alignment pad is not zeroLcOpNwdGeometry record 3: class 105 is not 94, 95 or 96 at +4With main (#293) the results are the same, except file I with default options:
LcOpNwdLogicalHierarchy at byte 543836: back-reference in a slot that needs a new object.Stack frames (#292, default options)
E2, file D (in
ReadMaterial):E2, file I (a different place: the partition trailer, not the material):
File I on main (#293):
File E (UTF-8, also in
ReadMaterial):File H:
All geometry errors (
point record terminator,class 105) come fromGeometrySegmentReader.ReadAsync(GeometrySegmentReader.cs:37).A small request, not a bug. The docs say
NwcNode.IfcGlobalIdis set only on Revit element nodes, and thatis what I see. A, B and C are built from IFC (
lcldifc), and their GlobalId is in the properties:Element / GlobalIdandElement / IfcGUID(43 372 times in A, 7 775 times in C). CouldIfcGlobalIdbefilled from these properties for IFC-built files? We use the GlobalId to link a model element to our
equipment list.
I can run the next build on the same files at any time.
mahach666 commentedon Dec 4, 2026
Hi @SergeyPriem, thanks for the detailed rerun. Could you try the same 11 files on
mainat7f95f0d, both with the default settings and with--no-tree?ReadMaterialalignment error locally. It also reads property value type15and accepts point record flags0and1.105cylinder sides and class104circular caps as triangle geometry. We verified both on NWC and NWD files generated from RVM. Your G and I files would help confirm whether this covers the records you encountered.NwcNode.SourceIfcGlobalIdand assourceIfcGlobalIdin the scene-tree JSON. Could you check that it matchesElement / GlobalIdorElement / IfcGUIDin A, B, and C?For any remaining failure, please send the file label, the mode, and the exact error message.
If any models still fail and you have permission to share them, would you be willing to send just those models through a private channel we agree on? We’d use them only to investigate the failures and keep the files, their details, and the fact that you shared them strictly private.
SergeyPriem commentedon Dec 4, 2026
Thank you. I ran the same 11 files on main at 7f95f0d with the CLI, with the default settings and with
--no-tree. .NET SDK 10.0.404, Windows 11 x64; the repository tests pass on this machine (net10.0).Result: still 6 of 11 open fully (A, B, C, F, OK-1, OK-2, both modes). D, E, G, H and I still fail, but
every one of them now fails at a new place, further on:
and I record 80.
--no-treethey fail later, inLcOpNwdFragments.--no-treeLcOaPartitionProps stream 0 at byte 197224: class 76, which this slot does not allowLcOpNwdFragments at byte 150692512: class 17, which this slot does not allowLcOpNwdLogicalHierarchy at byte 16998232: string is not valid UTF-8(no change)LcOpNwdFragments at byte 4044: null pointer in a slot that needs an objectLcOpNwdGeometry record 202: slot set does not match the class at +128LcOaPartitionProps stream 11 at byte 496172: class 76, which this slot does not allowLcOpNwdFragments at byte 12184332: null pointer in a slot that needs an objectLcOpNwdLogicalHierarchy at byte 543840: back-reference to unknown id 7434LcOpNwdGeometry record 80: slot set does not match the class at +128More diagnostics
To give you as much as I can without the files, I added context to the reader's errors in a local copy of
7f95f0d (not published): the reader state, the last objects read, and the i32 words around the failing byte.
Every string the parser read, every run that looks like text, and every f32/f64 value with |v| >= 100 is
masked, so the dumps show structure only. Source file names in the DbCache directory are replaced with
<source>. Here is what I see in them. Please check it, I may be wrong.E and H,
--no-tree,null pointer(slot allows class 93). In both files the word right after thenull is a new object of class 93 with exactly the next id: E
0000007D 0000005Dat byte 4044 (next id 125),H
00034392 0000005Dat byte 12184332 (next id 213906). So it looks like these class 13 fragments have onemore i32 (zero) before the class 93 pointer, and the parser reads the slot 4 bytes too early.
I, default,
back-reference to unknown id 7434(inReadPartitionTrailer, slot allows class 27).8 bytes before the pointer that failed there is
00001D09 0000001B: a new object with exactly the next id(7433) and class 27, the class the slot allows. It is followed by
00000001, then00001D0A 000000B9, whichlooks like a new object 7434 of class 185. So the trailer field before the pointer may be 8 bytes shorter in
this file than the parser expects.
D and H, default,
class 76in a partition root slot (allows 86, 79, 66, 70). Both are a new object withthe next id (D 1871, H 4312). In both files the class 76 body seems to start with a string (D:
FFFFFFFF,a null string; H: 12 bytes), followed by a new class 52 object (D id 1872, H id 4313).
D,
--no-tree,class 17in a fragment slot (allows 14, 15, 16): a new object with the next id(2470980), so a fragment class that is not known yet. Classes read in this stream before it:
13 x906 837, 14 x4 534, 15 x1 000, 16 x901 302, 93 x657 118.
G and I, geometry,
slot set does not match the class: both records are class 95 (lines) withnormals, no UV, no colour; p1 6, 6 positions, 144 bytes, 16 bytes left after the slots. G has only one
class 95 record (202); I has 188 (80 is the first). Record classes: G
94x9993 95x1 96x775 104x1150 105x693,I
94x192835 95x188 96x775 104x1782 105x1026.E, default,
string is not valid UTF-8(inReadMaterial, a class 31 object). The string is 6 bytes: a3-byte sequence with lead
0xEE(U+E000..U+EFFF, private use area), then a 3-byte sequenceED B?.., which isa UTF-16 low surrogate encoded on its own (CESU-8 / WTF-8 style). That is not strict UTF-8, so
Utf8.IsValidrejects it. Navisworks seems to write such strings; decoding with replacement (U+FFFD) instead ofthrowing would let the file open. The section header of all these files declares encoding
C.Diagnostic output for D, E, G, H, I (container, DbCache directory, both modes)
Line numbers in
LcObjectReader.csandGeometrySegmentReader.csare from my patched copy; the rest match7f95f0d.
#296,
SourceIfcGlobalId: it works. In A and B, 43 372 nodes have it, in C 7 775. On every one of them itis equal to
Element / GlobalIdand toElement / IfcGUID. No node has one without the other, and all valuesare distinct. For C I also have the source IFC file: all 7 775 values are GlobalIds of entities in it.
Thank you, this is exactly what we need.
About the files: thank you for the offer, but the models are under an NDA, so I cannot share them.
I am glad to keep running your builds on them and to send back any diagnostic output without model content.
If the masked context above is useful, I can send the patch that produces it.
mahach666 commentedon Dec 5, 2026
@SergeyPriem
Thanks for the detailed diagnostics. We’ve merged the follow-up fixes into main at df67a6f. They cover class 17 fragment transforms, class 76 text properties, class 95 lines with normals, the short partition-light record, and the material-name and appearance cases you reported. PR #298
We reproduced class 17 locally in Navisworks 2027 with non-uniform and mirrored DXF block insertions and verified the resulting world coordinates. We added regression tests for the other layouts based on your diagnostics. The local checks and CI passed.
Could you rerun D, E, G, H, and I on this commit, both with the default settings and with --no-tree? If a model still fails, the first error in each failing mode and any masked context you’re comfortable sharing would help us investigate. Redacted logs are enough. Thanks again for running these checks on your side.
SergeyPriem commentedon Dec 5, 2026
Thanks for your effort and fast updates. I hope this will help:
nwcio-reply-291-df67a6f.md
nwcio-three-rules-df67a6f.patch
mahach666 commentedon Dec 5, 2026
@SergeyPriem
Thanks for the patch and the detailed diagnostics. We merged the three fixes in PR #299, and you’re credited as a co-author on the commit.
Could you rerun all 11 models on main at 8ebcddb, both with the default settings and with --no-tree? That will confirm whether the merged version opens all 11 in both modes.
SergeyPriem commentedon Dec 6, 2026
Thank you for merging #299 and for the credit.
I ran all 11 files on main at 8ebcddb, unmodified: CLI, default settings and
--no-tree, .NET SDK 10.0.404,Windows 11 x64.
All 11 files open in both modes (22 of 22 runs, exit code 0).
--no-treethe world-space vertices, equal node names, materials and number of replaced characters. Tab names and property
values are equal in D and E. In H they differ only by the class 76 naming (label vs key), as expected.
Diagnosticsis empty for D, E and H.I did not run the net8.0 target (no .NET 8 runtime on this machine).
From my side issue #291 can be closed. Thank you for the quick work.