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.

PluginFormBase Class

The PluginFormBase class is the base class for plug-in dialogs. The class extends the FormBase class by adding communications with Tekla Structures.
Inheritance Hierarchy

Namespace:  Tekla.Structures.Dialog
Assembly:  Tekla.Structures.Dialog (in Tekla.Structures.Dialog.dll) Version: 2019.0.0.0 (2019.0.0.0)
Syntax
public class PluginFormBase : FormBase

The PluginFormBase type exposes the following members.

Constructors
  Name Description
Public method PluginFormBase
Runs the FormBase constructor and loads the default .NET localization file (DotNetDialogStrings.ail).
Top
Properties
  Name Description
Public property Localization
The localization instance for the dialog. Each dialog has its own localization instance that has read the localization files needed for that dialog.
(Inherited from FormBase.)
Public property ShowInTaskbar
Hides (shadows) the ShowInTaskbar property by setting the property to false.
Top
Methods
  Name Description
Public method ApplyValues
Loads the dialog values from a file and performs Apply on the loaded values. To match the files to a certain dialog, the file suffix is set as the dialog type's name.
(Inherited from FormBase.)
Public method Get
Gets the dialog values from the part that is currently selected in Tekla Structures.
Public method GetConnectionStatus
Returns true if a proper connection to the Tekla Structures process has been established. Currently, there's no way to re-establish the connection.
(Inherited from FormBase.)
Public method InitializeForm
Prepares the data storage for the dialog and scans through the fields.
(Inherited from FormBase.)
Public method LoadValues
Loads the dialog values from a file. To match the files to a certain dialog, the file suffix is set as the dialog type's name.
(Inherited from FormBase.)
Public method ModifyValues
Loads the dialog values from a file and performs Modify on the loaded values. To match the files to a certain dialog, the file suffix is set as the dialog type's name.
(Inherited from FormBase.)
Public method ReloadForm
Reloads the dialog values.
Public method SaveValues
Serializes the dialog values to an xml file.
(Inherited from FormBase.)
Public methodCode example SetAttributeValue
Sets a value for the given control. When the dialog is not shown, setting a property directly for a control (such as textBox1.Text = "text") will not work for controls that have a Tekla Structures AttributeTypeName set. This method is going to have to be used to set the value.
(Inherited from FormBase.)
Public method ShowForm
Displays the form.
(Inherited from FormBase.)
Public method UpdateValues Obsolete.
Rereads and updates all the field values on the form.
(Inherited from FormBase.)
Top
Events
  Name Description
Public event AttributesLoadedFromModel
The AttributesLoadedFromModel event is triggered just after the attributes have been loaded from the model into the dialog.
Top
Examples
The following example shows a situation where a class is created by using inheritance from the PluginFormBase. Due to limited space a better example is located in the Open API Start-up Package in Extranet. The name of the example is FormPlugin.
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Tekla.Structures.Datatype;
using Tekla.Structures.Dialog;

public class Example1 : PluginFormBase
{
    private void InitializeComponent()
    {
        this.OkButton = new System.Windows.Forms.Button();
        this.ModifyButton = new System.Windows.Forms.Button();
        this.SuspendLayout();
        // 
        // OkButton
        // 
        this.structuresExtender.SetAttributeName(this.OkButton, null);
        this.structuresExtender.SetAttributeTypeName(this.OkButton, null);
        this.structuresExtender.SetBindPropertyName(this.OkButton, null);
        this.OkButton.Name = "OkButton";
        this.OkButton.Text = "OK";
        this.OkButton.Click += new System.EventHandler(this.OkButton_Click);
        // 
        // ModifyButton
        // 
        this.structuresExtender.SetAttributeName(this.ModifyButton, null);
        this.structuresExtender.SetAttributeTypeName(this.ModifyButton, null);
        this.structuresExtender.SetBindPropertyName(this.ModifyButton, null);
        this.ModifyButton.Name = "ModifyButton";
        this.ModifyButton.Text = "Modify";
        this.ModifyButton.Click += new System.EventHandler(this.ModifyButton_Click);
        // 
        // Example1
        // 
        this.structuresExtender.SetAttributeName(this, null);
        this.structuresExtender.SetAttributeTypeName(this, null);
        this.structuresExtender.SetBindPropertyName(this, null);
        this.Controls.Add(this.ModifyButton);
        this.Controls.Add(this.OkButton);
        this.Name = "Example1";
        this.ResumeLayout(false);
    }

    public Example1()
    {
        InitializeComponent();
    }

    private void OkButton_Click(object sender, EventArgs e)
    {
        this.Apply();
        this.Close();
    }

    private void ModifyButton_Click(object sender, EventArgs e)
    {
        this.Modify();
    }

    private System.Windows.Forms.Button OkButton;
    private System.Windows.Forms.Button ModifyButton;
}
See Also