NwcIO.Cli
0.4.0
See the version list below for details.
dotnet tool install --global NwcIO.Cli --version 0.4.0
dotnet new tool-manifest
dotnet tool install --local NwcIO.Cli --version 0.4.0
#tool dotnet:?package=NwcIO.Cli&version=0.4.0
nuke :add-package NwcIO.Cli --version 0.4.0
<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.1containers, continuous zlib compression/decompression (lichunk-008,lizlib), and checksum gap framing without third-party libraries. Programmatically create, modify, and save.nwcfiles 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 viaIfcRelDefinesByType), 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_STRIPbuffers 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
.glbfiles 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
.objwith 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
.nwfexternal 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 standardcamerasandnodesin glTF 2.0 (GLB), outputs them in JSON, and exports to buildingSMART BCF 2.1 zip archives (SaveViewpointsBcf). - Selection Sets & Dynamic Search Sets: Strongly-typed model hierarchy (
NwcSelectionSet,NwcSearchSet,NwcSelectionSetFolder) with scene graph query evaluation. Dynamic search rules (NwcSearchCondition) with rich operators (Equals,NotEquals,Contains,StartsWith,Wildcard,GreaterThan, etc.) filtering by properties, categories, names, and GUIDs. Standard Autodesk Navisworks Selection Sets XML (.xml) reader and writer (ExportSelectionSetsXml). - 4D TimeLiner Construction Schedules: Work Breakdown Structure (WBS) task trees (
NwcTimeLinerSchedule,NwcTimeLinerTask) with planned and actual schedules, budget tracking, and selection set bindings. 4D temporal simulation engine (GetActiveTasksAt,GetSimulationProgressAt,GetNodeStateAt) and standard TimeLiner CSV exchange (ExportTimeLinerCsv). - 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
LcOpDBCachevirtual 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"
# Export Selection Sets and Search Sets to Autodesk Navisworks XML format
nwcio model.nwc selection_sets.xml
nwcio model.nwc --sets-xml ./selection_sets.xml
# Export 4D TimeLiner schedule to CSV spreadsheet format
nwcio model.nwc timeliner.csv
nwcio model.nwc --timeliner-csv ./schedule.csv
# Simulate 4D construction progress at a milestone date
nwcio model.nwc --timeliner-simulate 2026-06-01 --report
Navisworks Appearance Profiler & Color Overrides
# Apply Appearance Profiler XML rules to recolor model before GLB/IFC export
nwcio model.nwc model.glb --profiler rules.xml
# Export Appearance Profiler rules from document to XML
nwcio model.nwc --export-profiler rules.xml
Exit Codes
0— Success1— Usage error (missing or invalid arguments)2— File or directory not found3— 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");
Selection Sets & Dynamic Search Sets
using NwcIO.Model.Sets;
// Add an explicit selection set
var selection = new NwcSelectionSet("Ground Columns", [10, 11, 12, 13]);
// Add a dynamic search set evaluating properties across the scene graph
var search = new NwcSearchSet("Structural Concrete",
[
new NwcSearchCondition
{
Category = "Item",
Property = "Type",
Operator = NwcSearchOperator.Contains,
Value = "Concrete"
}
]);
// Evaluate search set dynamically against the document
var matchedNodes = search.Evaluate(doc);
Console.WriteLine($"Found {matchedNodes.Count} matching concrete elements.");
// Export selection sets and search sets to standard Navisworks XML
doc.ExportSelectionSetsXml("sets.xml");
4D TimeLiner Construction Scheduling & Simulation
using NwcIO.Model.TimeLiner;
// Inspect 4D schedule
if (doc.TimeLiner != null)
{
Console.WriteLine($"Total Planned Cost: {doc.TimeLiner.TotalPlannedCost:C}");
Console.WriteLine($"Project Duration: {doc.TimeLiner.OverallStart:d} - {doc.TimeLiner.OverallEnd:d}");
// Simulate construction progress at a target date
var milestone = new DateTimeOffset(2026, 6, 1, 0, 0, 0, TimeSpan.Zero);
double progress = doc.TimeLiner.GetSimulationProgressAt(milestone);
var activeTasks = doc.TimeLiner.GetActiveTasksAt(milestone);
Console.WriteLine($"Simulation Progress: {progress * 100:F1}%");
Console.WriteLine($"Active Tasks: {activeTasks.Count}");
// Query node state (NotStarted, InProgress, Completed) for 4D visual simulation
var state = doc.TimeLiner.GetNodeStateAt(nodeId: 42, milestone);
Console.WriteLine($"Node #42 state: {state}");
// Export schedule to standard TimeLiner CSV
doc.ExportTimeLinerCsv("construction_schedule.csv");
}
Autodesk Navisworks Appearance Profiler
Systematically override colors and transparencies across disciplines (HVAC, piping, architecture, structural):
using NwcIO.Model.Appearance;
using NwcIO.Model.Sets;
var profiler = new NwcAppearanceProfiler();
// Add color overrides based on properties
profiler.AddRule(
name: "Supply Air Blue",
category: "Mechanical",
property: "System",
op: NwcSearchOperator.Equals,
value: "Supply Air",
color: new RgbaColor(0.0f, 0.45f, 0.85f, 1.0f),
transparency: 0.1f);
profiler.AddRule(
name: "Exhaust Air Magenta",
category: "Mechanical",
property: "System",
op: NwcSearchOperator.Equals,
value: "Exhaust",
color: new RgbaColor(0.85f, 0.1f, 0.6f, 1.0f),
transparency: 0.2f);
// Apply rules to document scene graph and 3D meshes
int overridden = doc.ApplyAppearanceProfiler(profiler);
Console.WriteLine($"Overrode appearance of {overridden} elements.");
// Export profiler rules to standard Autodesk Navisworks XML format (.xml)
doc.ExportAppearanceProfilerXml("appearance_rules.xml");
// Load external XML rules and apply to any model or assembly
var externalRules = NwcXmlAppearanceProfilerSerializer.Open("external_rules.xml");
assembly.ApplyAppearanceProfiler(externalRules);
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 | Versions 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. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.17.0 | 75 | 11/20/2026 |
| 0.16.0 | 46 | 11/19/2026 |
| 0.15.1 | 59 | 11/19/2026 |
| 0.15.0 | 52 | 11/19/2026 |
| 0.14.0 | 118 | 11/18/2026 |
| 0.13.0 | 109 | 11/17/2026 |
| 0.12.1 | 115 | 11/15/2026 |
| 0.12.0 | 99 | 11/14/2026 |
| 0.11.0 | 112 | 11/13/2026 |
| 0.10.0 | 126 | 11/11/2026 |
| 0.9.0 | 86 | 11/10/2026 |
| 0.8.0 | 91 | 11/10/2026 |
| 0.7.0 | 93 | 11/10/2026 |
| 0.6.0 | 95 | 11/10/2026 |
| 0.5.0 | 93 | 11/10/2026 |
| 0.4.0 | 92 | 11/10/2026 |
| 0.3.0 | 92 | 11/10/2026 |
| 0.2.0 | 89 | 11/10/2026 |
| 0.1.1 | 85 | 11/10/2026 |
| 0.1.0 | 92 | 11/10/2026 |