Class NwcDocument
- Namespace
- NwcIO
- Assembly
- NwcIO.dll
An opened Navisworks document (.nwc cache, .nwd document) parsed without Navisworks installed.
public sealed class NwcDocumentInheritance
Inherited Members
Properties
AppearanceProfiler
Navisworks Appearance Profiler color/transparency rules associated with the document.
public NwcAppearanceProfiler? AppearanceProfiler { get; set; }Property Value
BoundingBox
Gets the total 3D bounding box over all meshes in the document.
public BoundingBox3d BoundingBox { get; }Property Value
ClashTests
Configured Clash Detective tests and results for this document.
public List<NwcClashTest> ClashTests { get; }Property Value
DbCache
Database cache directory parsed from LcOpDBCache streams.
public NwcDbCacheDirectory? DbCache { get; }Property Value
DefaultViewpoint
Gets the primary/default viewpoint of the document.
public NwcSavedViewpoint? DefaultViewpoint { get; }Property Value
FileInfo
public NwcFileInfo FileInfo { get; }Property Value
GridSystem
Spatial grid system (axes and levels) associated with the document.
public NwcGridSystem? GridSystem { get; set; }Property Value
Guids
GUIDs from the GUID table streams, in file order.
public IReadOnlyList<Guid> Guids { get; }Property Value
Materials
Surface materials, RGBA colors and PBR properties extracted from properties and categories.
public IReadOnlyList<NwcMaterial> Materials { get; }Property Value
Meshes
3D polygon meshes extracted from geometry streams and TOC tables.
public IReadOnlyList<NwcMesh> Meshes { get; }Property Value
PropertyRecords
Flat records parsed from the scene-tree/property streams.
public IReadOnlyList<NwcPropertyRecord> PropertyRecords { get; }Property Value
RootNode
Root of the hierarchical scene graph tree (matching Navisworks selection tree).
public NwcNode? RootNode { get; }Property Value
SavedViewpoints
Saved viewpoints and camera views extracted from container viewpoint streams.
public IReadOnlyList<NwcSavedViewpoint> SavedViewpoints { get; }Property Value
SelectionSets
Selection Sets and Search Sets defined in the document.
public IReadOnlyList<NwcSetItem> SelectionSets { get; }Property Value
SpatialIndex
3D spatial acceleration index (BVH) over meshes for raycasting and spatial selection.
public NwcSpatialIndex SpatialIndex { get; }Property Value
TimeLiner
4D TimeLiner construction simulation schedule.
public NwcTimeLinerSchedule? TimeLiner { get; set; }Property Value
Transforms
3D spatial transformations and bounding boxes parsed from transform streams.
public IReadOnlyList<NwcTransform> Transforms { get; }Property Value
XRefs
External references (XRefs) parsed from XRefJson streams.
public NwcXRefTable? XRefs { get; }Property Value
Methods
ApplyAppearanceProfiler(NwcAppearanceProfiler)
Applies an appearance profiler to colorize the document based on property rules.
public int ApplyAppearanceProfiler(NwcAppearanceProfiler profiler)Parameters
profilerNwcAppearanceProfiler
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
gridSystemNwcGridSystem?
Returns
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
revisionNwcDocumentoptionsNwcDiffOptions?
Returns
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
fileInfoNwcFileInfo?meshesIEnumerable<NwcMesh>?transformsIEnumerable<NwcTransform>?savedViewpointsIEnumerable<NwcSavedViewpoint>?guidsIEnumerable<Guid>?propertyRecordsIEnumerable<NwcPropertyRecord>?materialsIEnumerable<NwcMaterial>?rootNodeNwcNode?xRefsNwcXRefTable?dbCacheNwcDbCacheDirectory?selectionSetsIEnumerable<NwcSetItem>?timeLinerNwcTimeLinerSchedule?appearanceProfilerNwcAppearanceProfiler?
Returns
ExportAppearanceProfilerXml(string)
Exports the document appearance profiler rules to a Navisworks XML format (.xml).
public void ExportAppearanceProfilerXml(string path)Parameters
pathstring
ExportAppearanceProfilerXml(Stream)
Exports the document appearance profiler rules to an XML stream.
public void ExportAppearanceProfilerXml(Stream stream)Parameters
streamStream
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
ExportClashBcf(Stream, string?)
Exports detected clash results to a BCF 2.1 stream.
public void ExportClashBcf(Stream stream, string? testName = null)Parameters
ExportClashReportXml(string, string?)
Exports detected clash results to Autodesk Navisworks Clash Report XML format.
public void ExportClashReportXml(string path, string? testName = null)Parameters
ExportClashReportXml(Stream, string?)
Exports detected clash results to an XML stream.
public void ExportClashReportXml(Stream stream, string? testName = null)Parameters
ExportSelectionSetsXml(string)
Exports the document selection sets and search sets to Navisworks XML format.
public void ExportSelectionSetsXml(string path)Parameters
pathstring
ExportSelectionSetsXml(Stream)
Exports the document selection sets and search sets to an XML stream.
public void ExportSelectionSetsXml(Stream stream)Parameters
streamStream
ExportTimeLinerCsv(string)
Exports the 4D TimeLiner schedule to CSV format.
public void ExportTimeLinerCsv(string path)Parameters
pathstring
ExportTimeLinerCsv(Stream)
Exports the 4D TimeLiner schedule to a CSV stream.
public void ExportTimeLinerCsv(Stream stream)Parameters
streamStream
ExportTimeLinerMsProject(string)
Exports the 4D TimeLiner schedule to Microsoft Project XML format (.xml).
public void ExportTimeLinerMsProject(string path)Parameters
pathstring
ExportTimeLinerMsProject(Stream)
Exports the 4D TimeLiner schedule to a Microsoft Project XML stream.
public void ExportTimeLinerMsProject(Stream stream)Parameters
streamStream
ExportTimeLinerPrimavera(string)
Exports the 4D TimeLiner schedule to Primavera P6 XER format (.xer).
public void ExportTimeLinerPrimavera(string path)Parameters
pathstring
ExportTimeLinerPrimavera(Stream)
Exports the 4D TimeLiner schedule to a Primavera P6 XER stream.
public void ExportTimeLinerPrimavera(Stream stream)Parameters
streamStream
ExportTimeLinerXml(string)
Exports the 4D TimeLiner schedule to Navisworks XML exchange format (.xml).
public void ExportTimeLinerXml(string path)Parameters
pathstring
ExportTimeLinerXml(Stream)
Exports the 4D TimeLiner schedule to a Navisworks XML exchange stream.
public void ExportTimeLinerXml(Stream stream)Parameters
streamStream
ExtractGridSystem()
Automatically extracts grid lines from scene hierarchy nodes and metadata.
public NwcGridSystem ExtractGridSystem()Returns
FindNodes(NwcSearchCondition)
Finds all scene graph nodes matching a search condition.
public List<NwcNode> FindNodes(NwcSearchCondition condition)Parameters
conditionNwcSearchCondition
Returns
FindSet(string)
Finds a selection set or search set by name in the document sets hierarchy.
public NwcSetItem? FindSet(string name)Parameters
namestring
Returns
ImportTimeLinerMsProject(string)
Loads or imports a 4D TimeLiner schedule from Microsoft Project XML format (.xml).
public void ImportTimeLinerMsProject(string path)Parameters
pathstring
ImportTimeLinerPrimavera(string)
Loads or imports a 4D TimeLiner schedule from Primavera P6 XER format (.xer).
public void ImportTimeLinerPrimavera(string path)Parameters
pathstring
ImportTimeLinerXml(string)
Loads or imports a 4D TimeLiner schedule from Navisworks XML exchange format (.xml).
public void ImportTimeLinerXml(string path)Parameters
pathstring
LoadClashReportXml(string)
Loads clash detective tests and results from a Navisworks Clash Report XML file.
public List<NwcClashTest> LoadClashReportXml(string path)Parameters
pathstring
Returns
Open(string, NwcReaderOptions?)
Opens and parses a Navisworks file from disk.
public static NwcDocument Open(string path, NwcReaderOptions? options = null)Parameters
pathstringoptionsNwcReaderOptions?
Returns
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
streamStreamoptionsNwcReaderOptions?fallbackNamestring?
Returns
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
testNwcClashTest?
Returns
Save(string, string?)
Saves the document to an Autodesk Navisworks (.nwc) file.
public void Save(string path, string? header = null)Parameters
Save(Stream, string?)
Saves the document to an output stream in Autodesk Navisworks (.nwc) format.
public void Save(Stream stream, string? header = null)Parameters
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
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
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
pathstringoptionsNwcHtmlViewerOptions?
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
pathstringoptionsNwcIfcExportOptions?
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
writerTextWriteroptionsNwcIfcExportOptions?
SaveJson(string, NwcJsonExportOptions?)
Exports the document to a JSON file.
public void SaveJson(string path, NwcJsonExportOptions? options = null)Parameters
pathstringoptionsNwcJsonExportOptions?
SaveJson(Stream, NwcJsonExportOptions?)
Exports the document to a JSON stream.
public void SaveJson(Stream stream, NwcJsonExportOptions? options = null)Parameters
streamStreamoptionsNwcJsonExportOptions?
SaveObj(string, bool)
Exports 3D mesh geometry to a Wavefront OBJ file.
public void SaveObj(string path, bool worldCoordinates = true)Parameters
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
writerTextWriterworldCoordinatesbool
SaveViewpointsBcf(string)
Exports saved viewpoints to a buildingSMART BCF 2.1 zip archive (.bcfzip).
public void SaveViewpointsBcf(string path)Parameters
pathstring
SaveViewpointsBcf(Stream)
Exports saved viewpoints to a buildingSMART BCF 2.1 zip stream.
public void SaveViewpointsBcf(Stream stream)Parameters
streamStream
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
ToByteArray(string?)
Serializes the document to a byte array in Autodesk Navisworks (.nwc) format.
public byte[] ToByteArray(string? header = null)Parameters
headerstring?
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
optionsNwcIfcExportOptions?
Returns
ToJson(NwcJsonExportOptions?)
Serializes the document to a JSON string.
public string ToJson(NwcJsonExportOptions? options = null)Parameters
optionsNwcJsonExportOptions?
Returns
ToViewpointsXml(string)
Serializes saved viewpoints, cameras, clipping planes, and redlines to an Autodesk Navisworks XML viewpoints string.
public string ToViewpointsXml(string units = "m")Parameters
unitsstring