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.

Events Class

The Events class allows the user to register event listeners for drawing user interface events.
Inheritance Hierarchy

Namespace:  Tekla.Structures.Drawing.UI
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2023.0.1
public sealed class Events : MarshalByRefObject

The Events type exposes the following members.

Public methodEvents
Constructs a new instance of Events.
Public methodInitializeLifetimeService
Initializes the lifetime service.
(Overrides MarshalByRefObjectInitializeLifetimeService.)
Public methodOnInterrupted
Called when uesr interrupts.
Public methodRegister
Registers the instance to listen to the specified events.
Public methodUnRegister
Unregisters the instance from listening to events.
Public eventDocumentManagerClosed
The DocumentManagerClosed eventis raised when the document manager is closed.
Public eventDrawingEditorClosed
The DrawingEditorClosed event is raised when the drawing editor is closed.
Public eventDrawingEditorOpened
The DrawingEditorOpened event is raised when the drawing editor is opened.
Public eventDrawingListSelectionChanged
The DrawingListSelectionChanged event is raised when selection on the drawing list has changed.
Public eventDrawingLoaded
The DrawingLoaded event is raised when a new drawing is opened in the drawing editor.
Public eventInterrupted
Occurs when user interrupts.
Public eventSelectionChange
The SelectionChange event is raised when the selection is changed in a Tekla Structures drawing.
Asynchronous event handling

Registered event handlers are called asynchronously so that many handlers may be running simultaneously. Event handlers are not guaranteed to be run in the same thread where they were registered. The asynchronous nature of the events requires the use of synchronization constructs on objects and data structures that are not defined to be thread safe.

  • Microsoft's documentation about the lock statement: http://msdn.microsoft.com/en-us/library/c5kehkcz.aspx
  • Microsoft's documentation about delegates: http://msdn.microsoft.com/en-us/library/900fyy8e.aspx
  • Microsoft's documentation about managed threading: http://msdn.microsoft.com/en-us/library/1c9txz50.aspx
The following example shows how to make sure that only one selection event handler is running at a time.
using Tekla.Structures.Drawing;
using Tekla.Structures.Drawing.UI;

public class Example
    private Tekla.Structures.Drawing.UI.Events _events = new Tekla.Structures.Drawing.UI.Events();
    private object _selectionEventHandlerLock = new object();

    public void RegisterEventHandler()
        _events.SelectionChange += Events_SelectionChangeEvent;

    public void UnRegisterEventHandler()

    void Events_SelectionChangeEvent()
        /* Make sure that the inner code block is running synchronously */
            System.Console.WriteLine("Selection changed event received.");
See Also