Table of Contents

Class NwcGridSystem

Namespace
NwcIO.Model.Grids
Assembly
NwcIO.dll

A spatial grid system containing reference axes and lines (e.g. A, B, C / 1, 2, 3), capable of computing intersections, locating 3D coordinates relative to grids, and populating clash grid location tags.

public sealed class NwcGridSystem

Inheritance

Inherited Members

Constructors

NwcGridSystem()

public NwcGridSystem()

NwcGridSystem(string)

public NwcGridSystem(string name)

Parameters

name string

Properties

Lines

public List<NwcGridLine> Lines { get; }

Property Value

List<NwcGridLine>

Name

public string Name { get; set; }

Property Value

string

Methods

AddLine(NwcGridLine)

Adds a grid line to the system.

public NwcGridLine AddLine(NwcGridLine line)

Parameters

line NwcGridLine

Returns

NwcGridLine

AddLine(string, Vector3d, Vector3d, double, string?)

Adds a grid line to the system by name and endpoints.

public NwcGridLine AddLine(string name, Vector3d start, Vector3d end, double elevation = 0, string? systemName = null)

Parameters

name string
start Vector3d
end Vector3d
elevation double
systemName string?

Returns

NwcGridLine

AssignGridLocations(NwcClashTest)

Automatically populates NwcIO.Model.Clash.NwcClashResult.GridLocation for all clash results in a test.

public int AssignGridLocations(NwcClashTest test)

Parameters

test NwcClashTest

Returns

int

AssignGridLocations(NwcDocument)

Populates NwcIO.Model.Clash.NwcClashResult.GridLocation across all clash tests in a document.

public int AssignGridLocations(NwcDocument doc)

Parameters

doc NwcDocument

Returns

int

ExtractFromDocument(NwcDocument)

Automatically extracts grid lines from scene graph nodes if present.

public static NwcGridSystem ExtractFromDocument(NwcDocument doc)

Parameters

doc NwcDocument

Returns

NwcGridSystem

FindNearestGrid(Vector3d, out double, bool)

Finds the nearest grid line to the specified 3D point.

public NwcGridLine? FindNearestGrid(Vector3d point, out double distance, bool segmentOnly = false)

Parameters

point Vector3d
distance double
segmentOnly bool

Returns

NwcGridLine?

FindNearestIntersection(Vector3d, out double)

Finds the nearest grid intersection (e.g. "A / 1") to the specified 3D point.

public NwcGridIntersection? FindNearestIntersection(Vector3d point, out double distance)

Parameters

point Vector3d
distance double

Returns

NwcGridIntersection?

FormatLocation(Vector3d, double)

Formats a human-readable grid location descriptor for a 3D coordinate (e.g. "A / 1", "A (+1.20m) / 2 (-0.50m)").

public string FormatLocation(Vector3d point, double snapTolerance = 0.05)

Parameters

point Vector3d
snapTolerance double

Returns

string

GetIntersections()

Calculates all 2D/3D intersection points between crossing grid lines in this system.

public IReadOnlyList<NwcGridIntersection> GetIntersections()

Returns

IReadOnlyList<NwcGridIntersection>

LoadXml(string)

Loads a grid system from an XML file.

public static NwcGridSystem LoadXml(string path)

Parameters

path string

Returns

NwcGridSystem

ReadXml(Stream)

Loads a grid system from an XML stream.

public static NwcGridSystem ReadXml(Stream stream)

Parameters

stream Stream

Returns

NwcGridSystem

SaveXml(string)

Saves the grid system to an XML file.

public void SaveXml(string path)

Parameters

path string

SaveXml(Stream)

Saves the grid system to an XML stream.

public void SaveXml(Stream stream)

Parameters

stream Stream