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 TeklaModelInheritance
Inherited Members
Properties
Assemblies
All assemblies in the model.
public IReadOnlyList<ModelAssembly> Assemblies { get; }Property Value
Bolts
All bolt groups in the model.
public IReadOnlyList<ModelBolt> Bolts { get; }Property Value
Document
The source model database document.
public Db1Document Document { get; }Property Value
ModelGuid
The unique model identifier (GUID).
public Guid ModelGuid { get; }Property Value
Objects
All model objects, including parts, assemblies, bolts, welds and connections.
public IReadOnlyList<ModelObject> Objects { get; }Property Value
Parts
All parts (beams, columns, plates, slabs, etc.) in the model.
public IReadOnlyList<ModelPart> Parts { get; }Property Value
Welds
All welds in the model.
public IReadOnlyList<ModelWeld> Welds { get; }Property Value
Methods
FindAssembly(int)
Finds an assembly by its integer identifier, or returns null if not found.
public ModelAssembly? FindAssembly(int id)Parameters
idint
Returns
FindBolt(int)
Finds a bolt group by its integer identifier, or returns null if not found.
public ModelBolt? FindBolt(int id)Parameters
idint
Returns
FindObject(int)
Finds any model object by its integer identifier, or returns null if not found.
public ModelObject? FindObject(int id)Parameters
idint
Returns
FindObject(Guid)
Finds any model object by its GUID, or returns null if not found.
public ModelObject? FindObject(Guid guid)Parameters
guidGuid
Returns
FindPart(int)
Finds a part by its integer identifier, or returns null if not found.
public ModelPart? FindPart(int id)Parameters
idint
Returns
FindWeld(int)
Finds a weld by its integer identifier, or returns null if not found.
public ModelWeld? FindWeld(int id)Parameters
idint
Returns
ToIfc(TeklaIfcExportOptions?)
Serializes the decoded model to an IFC STEP physical file string.
public string ToIfc(TeklaIfcExportOptions? options = null)Parameters
optionsTeklaIfcExportOptions?-
Options controlling IFC export, or
nullfor 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
indentedbool-
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
streamStream-
The output stream.
optionsTeklaIfcExportOptions?-
Options controlling IFC export, or
nullfor 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
pathstring-
The destination file path.
optionsTeklaIfcExportOptions?-
Options controlling IFC export, or
nullfor defaults.
WriteJson(Stream, bool)
Writes the decoded model as JSON to a stream.
public void WriteJson(Stream stream, bool indented = false)Parameters
WriteJson(Utf8JsonWriter)
Writes the decoded model as JSON using a System.Text.Json.Utf8JsonWriter.
public void WriteJson(Utf8JsonWriter writer)Parameters
writerUtf8JsonWriter-
The UTF-8 JSON writer.