Table of Contents

Class NwcXRef

Namespace
NwcIO.Model
Assembly
NwcIO.dll

Represents an external cross-reference (XRef) to an external file (e.g., texture, CAD file, link model) referenced by a Navisworks document.

public sealed record NwcXRef : IEquatable<NwcXRef>

Inheritance

Implements

Inherited Members

Constructors

NwcXRef(string, string)

Represents an external cross-reference (XRef) to an external file (e.g., texture, CAD file, link model) referenced by a Navisworks document.

public NwcXRef(string OriginalPath, string RemappedPath)

Parameters

OriginalPath string
RemappedPath string

Properties

EffectivePath

Gets the most specific available path (remapped path if present, otherwise original path).

public string EffectivePath { get; }

Property Value

string

OriginalPath

public string OriginalPath { get; init; }

Property Value

string

RemappedPath

public string RemappedPath { get; init; }

Property Value

string

Methods

Exists(string?)

Checks whether the referenced file exists on disk, optionally relative to a base directory.

public bool Exists(string? baseDirectory = null)

Parameters

baseDirectory string?

Returns

bool

TryResolve(string?, out string)

Resolves the reference to an existing file. Relative paths are resolved against baseDirectory when provided, otherwise against the process working directory. An absolute stored path is tried first, and when it is missing the trailing path segments are matched under the base directory, longest suffix first, so a reference to <old-root>/Arch/A.nwc resolves to <base>/Arch/A.nwc before <base>/A.nwc.

public bool TryResolve(string? baseDirectory, out string resolvedPath)

Parameters

baseDirectory string?

Directory to resolve against, typically the directory of the referencing file.

resolvedPath string

The first existing candidate, in the order described above.

Returns

bool

True when an existing file was found.