Table of Contents

Class NwcDocument

Namespace
NwcIO
Assembly
NwcIO.dll

An opened Navisworks document (.nwc cache, .nwd document) parsed without Navisworks installed.

public sealed class NwcDocument

Inheritance

Inherited Members

Properties

AppearanceProfiler

Navisworks Appearance Profiler color/transparency rules associated with the document.

public NwcAppearanceProfiler? AppearanceProfiler { get; set; }

Property Value

NwcAppearanceProfiler?

BoundingBox

Gets the total 3D bounding box over all meshes in the document.

public BoundingBox3d BoundingBox { get; }

Property Value

BoundingBox3d

ClashTests

Configured Clash Detective tests and results for this document.

public List<NwcClashTest> ClashTests { get; }

Property Value

List<NwcClashTest>

DbCache

Database cache directory parsed from LcOpDBCache streams.

public NwcDbCacheDirectory? DbCache { get; }

Property Value

NwcDbCacheDirectory?

DefaultViewpoint

Gets the primary/default viewpoint of the document.

public NwcSavedViewpoint? DefaultViewpoint { get; }

Property Value

NwcSavedViewpoint?

FileInfo

public NwcFileInfo FileInfo { get; }

Property Value

NwcFileInfo

GridSystem

Spatial grid system (axes and levels) associated with the document.

public NwcGridSystem? GridSystem { get; set; }

Property Value

NwcGridSystem?

Guids

GUIDs from the GUID table streams, in file order.

public IReadOnlyList<Guid> Guids { get; }

Property Value

IReadOnlyList<Guid>

Materials

Surface materials, RGBA colors and PBR properties extracted from properties and categories.

public IReadOnlyList<NwcMaterial> Materials { get; }

Property Value

IReadOnlyList<NwcMaterial>

Meshes

3D polygon meshes extracted from geometry streams and TOC tables.

public IReadOnlyList<NwcMesh> Meshes { get; }

Property Value

IReadOnlyList<NwcMesh>

PropertyRecords

Flat records parsed from the scene-tree/property streams.

public IReadOnlyList<NwcPropertyRecord> PropertyRecords { get; }

Property Value

IReadOnlyList<NwcPropertyRecord>

RootNode

Root of the hierarchical scene graph tree (matching Navisworks selection tree).

public NwcNode? RootNode { get; }

Property Value

NwcNode?

SavedViewpoints

Saved viewpoints and camera views extracted from container viewpoint streams.

public IReadOnlyList<NwcSavedViewpoint> SavedViewpoints { get; }

Property Value

IReadOnlyList<NwcSavedViewpoint>

SelectionSets

Selection Sets and Search Sets defined in the document.

public IReadOnlyList<NwcSetItem> SelectionSets { get; }

Property Value

IReadOnlyList<NwcSetItem>

SpatialIndex

3D spatial acceleration index (BVH) over meshes for raycasting and spatial selection.

public NwcSpatialIndex SpatialIndex { get; }

Property Value

NwcSpatialIndex

TimeLiner

4D TimeLiner construction simulation schedule.

public NwcTimeLinerSchedule? TimeLiner { get; set; }

Property Value

NwcTimeLinerSchedule?

Transforms

3D spatial transformations and bounding boxes parsed from transform streams.

public IReadOnlyList<NwcTransform> Transforms { get; }

Property Value

IReadOnlyList<NwcTransform>

XRefs

External references (XRefs) parsed from XRefJson streams.

public NwcXRefTable? XRefs { get; }

Property Value

NwcXRefTable?

Methods

ApplyAppearanceProfiler(NwcAppearanceProfiler)

Applies an appearance profiler to colorize the document based on property rules.

public int ApplyAppearanceProfiler(NwcAppearanceProfiler profiler)

Parameters

profiler NwcAppearanceProfiler

Returns

int

The total number of scene nodes and meshes whose appearance was overridden.

AssignGridLocations(NwcGridSystem?)

Populates clash grid location tags across all clash detective tests in this document using the provided or attached grid system.

public int AssignGridLocations(NwcGridSystem? gridSystem = null)

Parameters

gridSystem NwcGridSystem?

Returns

int

Compare(NwcDocument, NwcDiffOptions?)

Compares this document (as baseline) against a revision document, detecting additions, deletions, coordinate shifts, and property changes.

public NwcDiffReport Compare(NwcDocument revision, NwcDiffOptions? options = null)

Parameters

revision NwcDocument
options NwcDiffOptions?

Returns

NwcDiffReport

Create(NwcFileInfo?, IEnumerable<NwcMesh>?, IEnumerable<NwcTransform>?, IEnumerable<NwcSavedViewpoint>?, IEnumerable<Guid>?, IEnumerable<NwcPropertyRecord>?, IEnumerable<NwcMaterial>?, NwcNode?, NwcXRefTable?, NwcDbCacheDirectory?, IEnumerable<NwcSetItem>?, NwcTimeLinerSchedule?, NwcAppearanceProfiler?)

Creates a new NwcIO.NwcDocument programmatically from components.

public static NwcDocument Create(NwcFileInfo? fileInfo = null, IEnumerable<NwcMesh>? meshes = null, IEnumerable<NwcTransform>? transforms = null, IEnumerable<NwcSavedViewpoint>? savedViewpoints = null, IEnumerable<Guid>? guids = null, IEnumerable<NwcPropertyRecord>? propertyRecords = null, IEnumerable<NwcMaterial>? materials = null, NwcNode? rootNode = null, NwcXRefTable? xRefs = null, NwcDbCacheDirectory? dbCache = null, IEnumerable<NwcSetItem>? selectionSets = null, NwcTimeLinerSchedule? timeLiner = null, NwcAppearanceProfiler? appearanceProfiler = null)

Parameters

fileInfo NwcFileInfo?
meshes IEnumerable<NwcMesh>?
transforms IEnumerable<NwcTransform>?
savedViewpoints IEnumerable<NwcSavedViewpoint>?
guids IEnumerable<Guid>?
propertyRecords IEnumerable<NwcPropertyRecord>?
materials IEnumerable<NwcMaterial>?
rootNode NwcNode?
xRefs NwcXRefTable?
dbCache NwcDbCacheDirectory?
selectionSets IEnumerable<NwcSetItem>?
timeLiner NwcTimeLinerSchedule?
appearanceProfiler NwcAppearanceProfiler?

Returns

NwcDocument

ExportAppearanceProfilerXml(string)

Exports the document appearance profiler rules to a Navisworks XML format (.xml).

public void ExportAppearanceProfilerXml(string path)

Parameters

path string

ExportAppearanceProfilerXml(Stream)

Exports the document appearance profiler rules to an XML stream.

public void ExportAppearanceProfilerXml(Stream stream)

Parameters

stream Stream

ExportClashBcf(string, string?)

Exports detected clash results to a buildingSMART BCF 2.1 zip archive (.bcfzip).

public void ExportClashBcf(string path, string? testName = null)

Parameters

path string
testName string?

ExportClashBcf(Stream, string?)

Exports detected clash results to a BCF 2.1 stream.

public void ExportClashBcf(Stream stream, string? testName = null)

Parameters

stream Stream
testName string?

ExportClashReportXml(string, string?)

Exports detected clash results to Autodesk Navisworks Clash Report XML format.

public void ExportClashReportXml(string path, string? testName = null)

Parameters

path string
testName string?

ExportClashReportXml(Stream, string?)

Exports detected clash results to an XML stream.

public void ExportClashReportXml(Stream stream, string? testName = null)

Parameters

stream Stream
testName string?

ExportSelectionSetsXml(string)

Exports the document selection sets and search sets to Navisworks XML format.

public void ExportSelectionSetsXml(string path)

Parameters

path string

ExportSelectionSetsXml(Stream)

Exports the document selection sets and search sets to an XML stream.

public void ExportSelectionSetsXml(Stream stream)

Parameters

stream Stream

ExportTimeLinerCsv(string)

Exports the 4D TimeLiner schedule to CSV format.

public void ExportTimeLinerCsv(string path)

Parameters

path string

ExportTimeLinerCsv(Stream)

Exports the 4D TimeLiner schedule to a CSV stream.

public void ExportTimeLinerCsv(Stream stream)

Parameters

stream Stream

ExportTimeLinerMsProject(string)

Exports the 4D TimeLiner schedule to Microsoft Project XML format (.xml).

public void ExportTimeLinerMsProject(string path)

Parameters

path string

ExportTimeLinerMsProject(Stream)

Exports the 4D TimeLiner schedule to a Microsoft Project XML stream.

public void ExportTimeLinerMsProject(Stream stream)

Parameters

stream Stream

ExportTimeLinerPrimavera(string)

Exports the 4D TimeLiner schedule to Primavera P6 XER format (.xer).

public void ExportTimeLinerPrimavera(string path)

Parameters

path string

ExportTimeLinerPrimavera(Stream)

Exports the 4D TimeLiner schedule to a Primavera P6 XER stream.

public void ExportTimeLinerPrimavera(Stream stream)

Parameters

stream Stream

ExportTimeLinerXml(string)

Exports the 4D TimeLiner schedule to Navisworks XML exchange format (.xml).

public void ExportTimeLinerXml(string path)

Parameters

path string

ExportTimeLinerXml(Stream)

Exports the 4D TimeLiner schedule to a Navisworks XML exchange stream.

public void ExportTimeLinerXml(Stream stream)

Parameters

stream Stream

ExtractGridSystem()

Automatically extracts grid lines from scene hierarchy nodes and metadata.

public NwcGridSystem ExtractGridSystem()

Returns

NwcGridSystem

FindNodes(NwcSearchCondition)

Finds all scene graph nodes matching a search condition.

public List<NwcNode> FindNodes(NwcSearchCondition condition)

Parameters

condition NwcSearchCondition

Returns

List<NwcNode>

FindSet(string)

Finds a selection set or search set by name in the document sets hierarchy.

public NwcSetItem? FindSet(string name)

Parameters

name string

Returns

NwcSetItem?

ImportTimeLinerMsProject(string)

Loads or imports a 4D TimeLiner schedule from Microsoft Project XML format (.xml).

public void ImportTimeLinerMsProject(string path)

Parameters

path string

ImportTimeLinerPrimavera(string)

Loads or imports a 4D TimeLiner schedule from Primavera P6 XER format (.xer).

public void ImportTimeLinerPrimavera(string path)

Parameters

path string

ImportTimeLinerXml(string)

Loads or imports a 4D TimeLiner schedule from Navisworks XML exchange format (.xml).

public void ImportTimeLinerXml(string path)

Parameters

path string

LoadClashReportXml(string)

Loads clash detective tests and results from a Navisworks Clash Report XML file.

public List<NwcClashTest> LoadClashReportXml(string path)

Parameters

path string

Returns

List<NwcClashTest>

Open(string, NwcReaderOptions?)

Opens and parses a Navisworks file from disk.

public static NwcDocument Open(string path, NwcReaderOptions? options = null)

Parameters

path string
options NwcReaderOptions?

Returns

NwcDocument

Exceptions

FileNotFoundException

The file does not exist.

InvalidDataException

The file is not an LcUStream container.

Open(Stream, NwcReaderOptions?, string?)

Opens and parses a Navisworks file from a stream.

public static NwcDocument Open(Stream stream, NwcReaderOptions? options = null, string? fallbackName = null)

Parameters

stream Stream
options NwcReaderOptions?
fallbackName string?

Returns

NwcDocument

Exceptions

InvalidDataException

The stream is not an LcUStream container.

RunClashDetection(NwcClashTest?)

Executes clash detection across the document using the specified or default test configuration.

public NwcClashTest RunClashDetection(NwcClashTest? test = null)

Parameters

test NwcClashTest?

Returns

NwcClashTest

Save(string, string?)

Saves the document to an Autodesk Navisworks (.nwc) file.

public void Save(string path, string? header = null)

Parameters

path string
header string?

Save(Stream, string?)

Saves the document to an output stream in Autodesk Navisworks (.nwc) format.

public void Save(Stream stream, string? header = null)

Parameters

stream Stream
header string?

SaveGlb(string, bool)

Exports 3D mesh geometry, materials, and scene hierarchy to a binary glTF 2.0 file (.glb).

public void SaveGlb(string path, bool worldCoordinates = true)

Parameters

path string
worldCoordinates bool

SaveGlb(Stream, bool)

Exports 3D mesh geometry, materials, and scene hierarchy to a binary glTF 2.0 stream (.glb).

public void SaveGlb(Stream stream, bool worldCoordinates = true)

Parameters

stream Stream
worldCoordinates bool

SaveHtmlViewer(string, NwcHtmlViewerOptions?)

Exports the document to a standalone interactive 3D WebGL HTML viewer (.html) with zero external dependencies.

public void SaveHtmlViewer(string path, NwcHtmlViewerOptions? options = null)

Parameters

path string
options NwcHtmlViewerOptions?

SaveIfc(string, NwcIfcExportOptions?)

Exports 3D mesh geometry, materials, spatial structure, and properties to an IFC STEP physical file (.ifc).

public void SaveIfc(string path, NwcIfcExportOptions? options = null)

Parameters

path string
options NwcIfcExportOptions?

SaveIfc(TextWriter, NwcIfcExportOptions?)

Exports 3D mesh geometry, materials, spatial structure, and properties to a System.IO.TextWriter in IFC format.

public void SaveIfc(TextWriter writer, NwcIfcExportOptions? options = null)

Parameters

writer TextWriter
options NwcIfcExportOptions?

SaveJson(string, NwcJsonExportOptions?)

Exports the document to a JSON file.

public void SaveJson(string path, NwcJsonExportOptions? options = null)

Parameters

path string
options NwcJsonExportOptions?

SaveJson(Stream, NwcJsonExportOptions?)

Exports the document to a JSON stream.

public void SaveJson(Stream stream, NwcJsonExportOptions? options = null)

Parameters

stream Stream
options NwcJsonExportOptions?

SaveObj(string, bool)

Exports 3D mesh geometry to a Wavefront OBJ file.

public void SaveObj(string path, bool worldCoordinates = true)

Parameters

path string
worldCoordinates bool

SaveObj(TextWriter, bool)

Exports 3D mesh geometry to a System.IO.TextWriter in Wavefront OBJ format.

public void SaveObj(TextWriter writer, bool worldCoordinates = true)

Parameters

writer TextWriter
worldCoordinates bool

SaveViewpointsBcf(string)

Exports saved viewpoints to a buildingSMART BCF 2.1 zip archive (.bcfzip).

public void SaveViewpointsBcf(string path)

Parameters

path string

SaveViewpointsBcf(Stream)

Exports saved viewpoints to a buildingSMART BCF 2.1 zip stream.

public void SaveViewpointsBcf(Stream stream)

Parameters

stream Stream

SaveViewpointsXml(string, string)

Exports saved viewpoints, cameras, clipping planes, and redlines to an Autodesk Navisworks XML viewpoints file.

public void SaveViewpointsXml(string path, string units = "m")

Parameters

path string
units string

ToByteArray(string?)

Serializes the document to a byte array in Autodesk Navisworks (.nwc) format.

public byte[] ToByteArray(string? header = null)

Parameters

header string?

Returns

byte[]

ToIfcString(NwcIfcExportOptions?)

Serializes 3D mesh geometry, materials, spatial structure, and properties to an IFC STEP physical string.

public string ToIfcString(NwcIfcExportOptions? options = null)

Parameters

options NwcIfcExportOptions?

Returns

string

ToJson(NwcJsonExportOptions?)

Serializes the document to a JSON string.

public string ToJson(NwcJsonExportOptions? options = null)

Parameters

options NwcJsonExportOptions?

Returns

string

ToViewpointsXml(string)

Serializes saved viewpoints, cameras, clipping planes, and redlines to an Autodesk Navisworks XML viewpoints string.

public string ToViewpointsXml(string units = "m")

Parameters

units string

Returns

string