API Reference

Detailed and full API reference helps you master Tekla development

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

Meta.Microsoft.Help.Id
T:Tekla.Structures.Model.ModelInfo

ModelInfo Class

The ModelInfo class provides information about the currently open Tekla Structures model.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.ModelModelInfo

Namespace:  Tekla.Structures.Model
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2019.1.0.0 (2019.1.0.0)
Syntax
[SerializableAttribute]
public sealed class ModelInfo

The ModelInfo type exposes the following members.

Properties
  Name Description
Public property CurrentPhase
The number of the Tekla Structures model's current phase.
Public property ModelName
The name of the Tekla Structures model.
Public property ModelPath
The path to the Tekla Structures model.
Public property NorthDirection
The north direction of the current Tekla Structures model.
Public property SharedModel
The read-only property of the Tekla Structures model's sharing status.
Public property SingleUserModel
The read-only property if the Tekla Structures model is a single user model.
Top
Examples
When Tekla Structures is running the length of the model name tells you whether the model is open.
using Tekla.Structures.Model;
using System.Windows.Forms;

public class Example
{
    public void Example1()
    {
        Model CurrentModel = new Model();
        ModelInfo Info = CurrentModel.GetInfo();

        if (CurrentModel.GetConnectionStatus())
        {
            if (Info.ModelName.Length == 0)
            {
                MessageBox.Show("A Tekla Structures model is not open.");
            }
        }
    }
}
See Also