Table of Contents

Class TeklaModel

Namespace
TdbIO
Assembly
TdbIO.dll

Represents an in-memory, read-only object model decoded from a Tekla Structures model database (.db1).

public sealed class TeklaModel

Inheritance

Inherited Members

Properties

Assemblies

All assemblies in the model.

public IReadOnlyList<ModelAssembly> Assemblies { get; }

Property Value

IReadOnlyList<ModelAssembly>

Bolts

All bolt groups in the model.

public IReadOnlyList<ModelBolt> Bolts { get; }

Property Value

IReadOnlyList<ModelBolt>

Document

The source model database document.

public Db1Document Document { get; }

Property Value

Db1Document

ModelGuid

The unique model identifier (GUID).

public Guid ModelGuid { get; }

Property Value

Guid

Objects

All model objects, including parts, assemblies, bolts, welds and connections.

public IReadOnlyList<ModelObject> Objects { get; }

Property Value

IReadOnlyList<ModelObject>

Parts

All parts (beams, columns, plates, slabs, etc.) in the model.

public IReadOnlyList<ModelPart> Parts { get; }

Property Value

IReadOnlyList<ModelPart>

Welds

All welds in the model.

public IReadOnlyList<ModelWeld> Welds { get; }

Property Value

IReadOnlyList<ModelWeld>

Methods

FindAssembly(int)

Finds an assembly by its integer identifier, or returns null if not found.

public ModelAssembly? FindAssembly(int id)

Parameters

id int

Returns

ModelAssembly?

FindBolt(int)

Finds a bolt group by its integer identifier, or returns null if not found.

public ModelBolt? FindBolt(int id)

Parameters

id int

Returns

ModelBolt?

FindObject(int)

Finds any model object by its integer identifier, or returns null if not found.

public ModelObject? FindObject(int id)

Parameters

id int

Returns

ModelObject?

FindObject(Guid)

Finds any model object by its GUID, or returns null if not found.

public ModelObject? FindObject(Guid guid)

Parameters

guid Guid

Returns

ModelObject?

FindPart(int)

Finds a part by its integer identifier, or returns null if not found.

public ModelPart? FindPart(int id)

Parameters

id int

Returns

ModelPart?

FindWeld(int)

Finds a weld by its integer identifier, or returns null if not found.

public ModelWeld? FindWeld(int id)

Parameters

id int

Returns

ModelWeld?

ToIfc(TeklaIfcExportOptions?)

Serializes the decoded model to an IFC STEP physical file string.

public string ToIfc(TeklaIfcExportOptions? options = null)

Parameters

options TeklaIfcExportOptions?

Options controlling IFC export, or null for defaults.

Returns

string

An IFC STEP string representation of the model.

ToJson(bool)

Serializes the decoded model to a JSON string.

public string ToJson(bool indented = false)

Parameters

indented bool

Whether to format the JSON with indentation.

Returns

string

A JSON string representation of the model.

ValidateFiniteNumbers()

Validates that all geometric coordinates, lengths and numeric attributes are finite floating-point numbers.

public void ValidateFiniteNumbers()

Exceptions

InvalidDataException

Thrown when any coordinate, dimension or numeric attribute is NaN or Infinity.

WriteIfc(Stream, TeklaIfcExportOptions?)

Writes the decoded model as an IFC STEP physical file to a stream.

public void WriteIfc(Stream stream, TeklaIfcExportOptions? options = null)

Parameters

stream Stream

The output stream.

options TeklaIfcExportOptions?

Options controlling IFC export, or null for defaults.

WriteIfc(string, TeklaIfcExportOptions?)

Writes the decoded model as an IFC STEP physical file to a file path.

public void WriteIfc(string path, TeklaIfcExportOptions? options = null)

Parameters

path string

The destination file path.

options TeklaIfcExportOptions?

Options controlling IFC export, or null for defaults.

WriteJson(Stream, bool)

Writes the decoded model as JSON to a stream.

public void WriteJson(Stream stream, bool indented = false)

Parameters

stream Stream

The output stream.

indented bool

Whether to format the JSON with indentation.

WriteJson(Utf8JsonWriter)

Writes the decoded model as JSON using a System.Text.Json.Utf8JsonWriter.

public void WriteJson(Utf8JsonWriter writer)

Parameters

writer Utf8JsonWriter

The UTF-8 JSON writer.