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.

ModelHandler Class

The ModelHandler class provides information about the currently open Tekla Structures model.
Inheritance Hierarchy

Namespace:  Tekla.Structures.Model
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2021.0.0
public sealed class ModelHandler

The ModelHandler type exposes the following members.

  Name Description
Public method ModelHandler
Creates a new ModelHandler instance.
  Name Description
Public method Close
Closes current model.
Public method CreateNewMultiUserModel
Creates a new multi-user model.
Public method CreateNewSingleUserModel
Creates a new single user model.
Public method IsModelAutoSaved
Tells whether a model has auto saved information.
Public method IsModelSaved
Tells whether current model has been saved.
Public method Open
Opens a new model to Tekla Structures without saving changes to current model.
Public method Save(String, String)
Saves current model with comment and user information.
Public method Save(String, String, String)
Saves current model with comment and user information.
The following example opens the model that is in the C:\teklastructuresmodels\NewModel17 folder and shows a message if the opening was successful.
using Tekla.Structures.Model;
using System.Windows.Forms;

public class Example
       public void Example1()
           ModelHandler handler = new ModelHandler();
           if (handler.IsModelSaved())
               if (handler.Open("C:\\teklastructuresmodels\\NewModel17"))
                   MessageBox.Show("The model opened successfully.");
               MessageBox.Show("The current model is not saved.");
See Also