NwcIO 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package NwcIO --version 0.2.0
                    
NuGet\Install-Package NwcIO -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NwcIO" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NwcIO" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="NwcIO" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NwcIO --version 0.2.0
                    
#r "nuget: NwcIO, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NwcIO@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NwcIO&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=NwcIO&version=0.2.0
                    
Install as a Cake Tool

<p align="center"> <img src="docs/images/nwcio-banner.png" alt="NwcIO" width="640"> </p>

NwcIO

NwcIO is a fast, 100% managed .NET library and CLI tool that reads Autodesk Navisworks files (.nwc, .nwd, .nwf) directly from disk without requiring Autodesk Navisworks or the Navisworks API to be installed, and exports 3D geometry, materials, scene hierarchies, and properties to Industry Foundation Classes (IFC2x3 Coordination View), glTF 2.0 Binary (GLB), Wavefront OBJ, and JSON.

Built clean-room following the architectural principles of mahach666/RvtIO: zero native dependencies, zero external libraries, strict typing, high performance, and cross-platform compatibility.


What It Does

  • Container Serialization & Decompression (NwcWriter / NwcContainerReader): Direct byte-stream writing and parsing of #LcUStream-V1.1 containers, continuous zlib compression/decompression (lichunk-008, lizlib), and checksum gap framing without third-party libraries. Programmatically create, modify, and save .nwc files from code.
  • Fluent Document Builder (NwcDocumentBuilder): Construct Navisworks documents from scratch with 3D polygon meshes, spatial transformation matrices, hierarchy trees, materials, element GUIDs, and camera viewpoints.
  • Industry Foundation Classes (IFC2x3 & IFC4): Pure managed exporter generating ISO 10303-21 STEP physical files compliant with IFC2x3 Coordination View V2.0 (IfcFacetedBrep, IfcClosedShell, IfcFace, IfcPolyLoop, IfcCartesianPoint) and modern IFC4 Design Transfer / Reference View with compact mesh tessellation (IfcTriangulatedFaceSet, IfcCartesianPointList3D) reducing file sizes by over 60%, spatial hierarchy (IfcProject, IfcSite, IfcBuilding, IfcBuildingStorey), element mapping (IfcWall, IfcSlab, IfcColumn, IfcBeam, IfcReinforcingBar, etc.), type product definitions (IfcWallType, IfcSlabType, IfcColumnType, IfcReinforcingBarType, etc. linked via IfcRelDefinesByType), surface styles (IfcSurfaceStyle, IfcColourRgb), property sets (IfcPropertySet, IfcPropertySingleValue), and buildingSMART 22-character GUID encoding.
  • Hierarchical Scene Graph: Reconstructs Navisworks selection tree (Model → Layers → Categories → Families → Types → Composite Elements → Geometry) with bound parameters and GUIDs.
  • 3D Spatial Transforms: Decodes instance poses (double-precision translation vectors, unit rotation quaternions, local AABB bounding boxes) and generates analytic $4\times 4$ affine transformation matrices.
  • 3D Polygon Meshes: Reads geometry chunk streams via TOC (Table of Contents), unpacks IEEE 754 vertices, converts TRIANGLE_STRIP buffers with alternating normal windings, and transforms vertices to world coordinates.
  • Materials & RGBA Colors: Extracts surface materials and color triples (LcRevitElement, revit_Color), assigns standard BIM category palettes (concrete, rebar, insulation), and computes vertex/face normal vectors for PBR rendering.
  • Binary glTF 2.0 (GLB) Exporter: Generates specification-compliant .glb files with 12-byte header, 4-byte padded JSON chunk (0x20), 4-byte padded binary chunk (0x00), vertex positions, normals, indices, and PBR materials.
  • Wavefront OBJ Exporter: Streams 3D meshes to .obj with 1-based indexing in local or project world coordinates.
  • Spatial Acceleration Index (BVH): Balanced Bounding Volume Hierarchy over all meshes for sub-millisecond range queries (QueryBox) and double-precision Möller–Trumbore raycasting (Raycast).
  • Federated Multi-Model Assemblies (.nwf): Aggregates multiple discipline models into a unified coordination coordinate system, reads .nwf external references, and detects spatial clashes (FindClashes).
  • Saved Viewpoints & Cameras: Extracts user saved viewpoints and camera views (NwcCamera, NwcSavedViewpoint) from stream tag 517 (double-precision eye coordinates, unit rotation quaternions, viewing direction, up vector, focal distance, FOV, and aspect ratio). Automatically embeds viewpoints as standard cameras and nodes in glTF 2.0 (GLB), outputs them in JSON, and exports to buildingSMART BCF 2.1 zip archives (SaveViewpointsBcf).
  • buildingSMART BCF 2.1 Collaboration: Pure managed exporter generating standard BIM Collaboration Format (.bcfzip) archives with topic folders, markup.bcf, viewpoints (viewpoint.bcfv), perspective cameras focused on clash centers, and colored component highlights (IfcGuid).
  • Interactive HTML Clash Reports: Standalone, offline HTML clash detection report with a discipline cross-clash matrix ($M_i \times M_j$ frequency), KPI summary cards, live search/filtering, and sortable clash details table.
  • Embedded DB Cache: Decodes the internal LcOpDBCache virtual table directory (offsets, sizes, flags).

Install

Install the command line tool:

dotnet tool install --global NwcIO.Cli

Add the library to a .NET project:

dotnet add package NwcIO

The library targets .NET 8 and .NET 10. It is 100% managed code with zero native dependencies, running seamlessly on Windows, Linux, and macOS.


Command Line (nwcio)

Export to Industry Foundation Classes (IFC2x3 & IFC4)

# Export directly to IFC2x3 (Coordination View V2.0, Faceted BRep, Materials, Property Sets)
nwcio model.nwc model.ifc

# Export to modern compact IFC4 with IfcTriangulatedFaceSet and Type Objects
nwcio model.nwc model.ifc --ifc-schema IFC4

# Export without IFC type product definitions
nwcio model.nwc model.ifc --no-types

# Export with summary report to stderr
nwcio model.nwc model.ifc --ifc-schema IFC4 --report

Export to Binary glTF 2.0 (GLB)

# Export directly to GLB (with meshes, normals, materials, and colors)
nwcio model.nwc model.glb

# Export with summary report to stderr
nwcio model.nwc model.glb --report

Export to Wavefront OBJ

# Export 3D meshes to OBJ in world coordinate space
nwcio model.nwc model.obj

# Export in local coordinate space
nwcio model.nwc model.obj --local-coords

Export to Structured JSON

# Export full scene tree, properties, transforms, GUIDs, materials, and meshes
nwcio model.nwc model.json

# Compact (non-indented) JSON
nwcio model.nwc model.json --no-indent

# Include raw container stream catalog (offsets, lengths, stream kinds)
nwcio model.nwc model.json --catalog

Multi-Model Federated Assemblies & Clash Detection

# Load all .nwc models from a folder into a single federated assembly GLB
nwcio ./BuildingK4/ ./BuildingK4_assembly.glb --report

# Run cross-model geometric clash detection across contributing models
nwcio ./BuildingK4/ ./BuildingK4_assembly.glb --clashes --report

# Export detected clashes directly to buildingSMART BCF 2.1 zip archive
nwcio ./BuildingK4/ ./clashes.bcfzip

# Export interactive, self-contained HTML clash report with matrix
nwcio ./BuildingK4/ ./clash_report.html

# List all saved viewpoints and cameras to stdout
nwcio model.nwc --viewpoints

# Export saved viewpoints to buildingSMART BCF 2.1 zip archive
nwcio model.nwc --viewpoints-bcf ./viewpoints.bcfzip

# Simultaneous multi-format export
nwcio ./BuildingK4/ ./assembly.glb --bcf ./clashes.bcfzip --clash-html ./report.html --report

# Inspect Bounding Volume Hierarchy (BVH) spatial index statistics
nwcio model.nwc model.glb --bvh-stats --report

# Test 3D raycast against scene geometry (originX, originY, originZ, dirX, dirY, dirZ)
nwcio model.nwc --raycast "0,0,100,0,0,-1"

Exit Codes

  • 0 — Success
  • 1 — Usage error (missing or invalid arguments)
  • 2 — File or directory not found
  • 3 — Data format error or parsing failure

Library Usage (C#)

Reading a Navisworks Document

using NwcIO;

// Open document (parses container, properties, GUIDs, transforms, meshes, materials)
var doc = NwcDocument.Open("model.nwc");

Console.WriteLine($"Source RVT:   {doc.FileInfo.SourcePath}");
Console.WriteLine($"Plugin:       {doc.FileInfo.LoaderPlugin}");
Console.WriteLine($"Meshes:       {doc.Meshes.Count}");
Console.WriteLine($"Materials:    {doc.Materials.Count}");
Console.WriteLine($"GUIDs:        {doc.Guids.Count}");
Console.WriteLine($"Transforms:   {doc.Transforms.Count}");

// Save or clone back to Autodesk Navisworks (.nwc)
doc.Save("cloned_model.nwc");

// Export directly to IFC2x3, IFC4, GLB, OBJ, or JSON
doc.SaveIfc("model.ifc"); // Default IFC2x3
doc.SaveIfc("model_ifc4.ifc", new NwcIfcExportOptions
{
    SchemaVersion = NwcIfcSchemaVersion.Ifc4,
    ExportTypeObjects = true,
    UseTessellationInIfc4 = true,
});
doc.SaveGlb("model.glb", worldCoordinates: true);
doc.SaveObj("model.obj", worldCoordinates: true);
doc.SaveJson("model.json");

Programmatic Document Creation (NwcDocumentBuilder)

using NwcIO;
using NwcIO.Model;

// Construct a new Navisworks document from scratch
var newDoc = new NwcDocumentBuilder()
    .SetFileInfo("ArchitecturalModel.rvt", "LcOpRevitExport")
    .AddMesh(new NwcMesh
    {
        Id = 1,
        Name = "Concrete Slab",
        Vertices = [new(0, 0, 0), new(10, 0, 0), new(10, 8, 0), new(0, 8, 0)],
        Indices = [0, 1, 2, 2, 1, 3],
        BoundingBox = new BoundingBox3d(new(0, 0, 0), new(10, 8, 0))
    })
    .AddTransform(new NwcTransform
    {
        Id = 100,
        Translation = new Vector3d(0, 0, 3.2),
        Rotation = Quaterniond.Identity
    })
    .AddSavedViewpoint(new NwcSavedViewpoint
    {
        Name = "Main Entry View",
        Camera = new NwcCamera
        {
            Position = new Vector3d(5, -15, 12),
            Rotation = Quaterniond.Identity,
            FocalDistance = 20.0
        }
    })
    .AddGuid(Guid.NewGuid())
    .Build();

// Save as a standard Navisworks .nwc file
newDoc.Save("GeneratedModel.nwc");

3D Raycasting with BVH Spatial Index

// Spatial index is built lazily on first access and cached
var spatial = doc.SpatialIndex;

// Fast range query for meshes inside a bounding box
var hits = spatial.QueryBox(new BoundingBox3d(new(0, 0, 0), new(10, 10, 5)));

// Raycast against all polygon triangles in the scene
var origin = new Vector3d(5, 5, 20);
var direction = new Vector3d(0, 0, -1);

if (spatial.Raycast(origin, direction, out var hit))
{
    Console.WriteLine($"Hit mesh #{hit.Mesh.Id} at distance {hit.Distance:F2} m");
    Console.WriteLine($"Intersection point: {hit.Point}");
    Console.WriteLine($"Surface normal:     {hit.Normal}");
}

Multi-Model Federated Coordination & Clash Detection

using NwcIO.Model;

// Load an entire folder of models into a federated assembly
var assembly = NwcAssembly.LoadFromDirectory(@"C:\Projects\Campus", searchPattern: "*.nwc");

Console.WriteLine($"Models:   {assembly.Models.Count}");
Console.WriteLine($"Meshes:   {assembly.AllMeshes.Count}");
Console.WriteLine($"Bounds:   {assembly.BoundingBox}");

// Detect geometric clashes between elements from different models
var clashes = assembly.FindClashes(tolerance: 0.001);
foreach (var clash in clashes)
{
    Console.WriteLine($"Clash between {clash.ModelA.FileInfo.SourcePath} and {clash.ModelB.FileInfo.SourcePath}");
    Console.WriteLine($"Overlap volume: {clash.IntersectionBox}");
}

// Export the aggregated multi-discipline model to a single GLB or IFC file
assembly.SaveIfc("Campus_Coordination.ifc");
assembly.SaveGlb("Campus_Coordination.glb");

// Export clashes to standard buildingSMART BCF 2.1 archive (.bcfzip)
assembly.SaveBcf("Campus_Clashes.bcfzip", clashes);

// Export interactive, standalone HTML clash report with discipline matrix
assembly.SaveClashReportHtml("Campus_ClashReport.html", clashes);

Saved Viewpoints & Cameras

// Inspect saved viewpoints and camera parameters
foreach (var vp in doc.SavedViewpoints)
{
    var cam = vp.Camera;
    Console.WriteLine($"Viewpoint: {vp.Name} ({cam.Projection})");
    Console.WriteLine($"  Eye:        {cam.Position}");
    Console.WriteLine($"  Direction:  {cam.Direction}");
    Console.WriteLine($"  Target:     {cam.Target}");
    Console.WriteLine($"  Focal dist: {cam.FocalDistance:F2} m, FOV: {cam.FieldOfView:F1}°");
}

// Export saved viewpoints directly to buildingSMART BCF 2.1 zip archive
doc.SaveViewpointsBcf("viewpoints.bcfzip");
assembly.SaveViewpointsBcf("assembly_viewpoints.bcfzip");

Performance

Tested on representative multi-discipline BIM models and campus assemblies:

Metric Single Model (~250 KB) Federated Assembly (~3 MB) Multi-Building Campus (~10 MB)
File size 250 KB .nwc 2.8 MB (3 files) ~10 MB (8 buildings)
Meshes 573 2 861 20 000+
Vertices 19 930 95 000+ 550 000+
Triangles 18 784 88 000+ 520 000+
Parsing time 98 ms 572 ms < 1.5 s
Export output 971 KB .glb 5.01 MB .glb ~30 MB .glb
BVH Build < 2 ms < 6 ms < 25 ms

License and trademarks

NwcIO is licensed under the MIT License. Copyright © 2026 mahach666.

NwcIO is not affiliated with, endorsed by, or sponsored by Autodesk. Autodesk, Navisworks, and Revit are trademarks of Autodesk, Inc.

The file format is read by analysing binary stream structures for interoperability. No Autodesk code or binaries are included.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NwcIO:

Package Downloads
NwcIO.Scene

Turns a Navisworks model read by NwcIO into an IOScene scene document in metres: the selection tree, element GUIDs and IFC GlobalIds, property tabs, geometry with instancing, file colours and Revit levels and grids.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.17.0 132 11/20/2026
0.16.0 117 11/19/2026
0.15.1 109 11/19/2026
0.15.0 106 11/19/2026
0.14.0 144 11/18/2026
0.13.0 353 11/17/2026
0.12.1 605 11/15/2026
0.12.0 96 11/14/2026
0.11.0 98 11/13/2026
0.10.0 104 11/11/2026
0.9.0 87 11/10/2026
0.8.0 83 11/10/2026
0.7.0 87 11/10/2026
0.6.0 95 11/10/2026
0.5.0 81 11/10/2026
0.4.0 96 11/10/2026
0.3.0 96 11/10/2026
0.2.0 90 11/10/2026
0.1.1 83 11/10/2026
0.1.0 88 11/10/2026