Guides and Articles

Use this documentation when building your Tekla Structures apps

Tekla Structures 2018i Open API Release Notes

Updated: 2 Feb 2021

Tekla Open API

Tekla.Structures.Drawings 2018.1.0.0. Assembly



A new method, GetModelObjectIdentifiers(Drawing drawing), has been added to the DrawingHandler class for asking all included model object identifiers in the drawing.



There are now new options for DPMPrinterAttributes:

  • Plot - print to a plot file.

  • Image - print to a png image file. The file name will be <OutputName>-<PageNumber>-gdi.png where PageNumber is 1 or greater.



New methods have been added to Open API:

  • Size.ToString() converts a drawing layout size to a string value expressed either in mm or in imperial units according to advanced option settings. The advanced options XS_IMPERIAL and XS_IMPERIAL_INPUT both need to be set to TRUE to return the sheet size in imperial units. Additionally, set XS_USE_ONLY_INCHES_IN_SHEET_SIZES to TRUE to return the sheet size in fractional inches only, otherwise the sizes will be in feet-inch format.

  • Distance.ToFractionalInchesString() returns a string representation of the distance expressed in fractional inches (no feet).

See the Open API documentation for full details and example code.



Modifying drawing objects through Open API now only locks attributes that have changed. Other attributes can be changed from the view settings dialog box.



It is now possible to control individually for each tag position whether counting is enabled in dimension mark tags. The IncludePartCountInTagA, IncludePartCountInTagB, .., IncludePartCountInTagG properties have been added to Tekla.Structures.Drawing.StraightDimensionSet.StraightDimensionSetAttributes.

The former property IncludePartCountInTag reflects whether at least one position has counting enabled. When set, IncludePartCountInTag changes the value for all the positions.



Previously, there could be extra invisible mark objects returned when iterating through marks in a view (View.GetAllObjects(typeof(MarkBase)). This does not happen anymore.

Merged bolt marks are now MarkSet instances.



There is a new member, TransparentBackground, in the text class attributes to show whether transparency is used in the text background.



Previously, an exception was thrown for the following methods when a model contained multiple UDA definitions for the same UDA name:

* public bool GetStringUserProperties(List<string> names, out Dictionary<string, string> values)

* public bool GetIntegerUserProperties(List<string> names, out Dictionary<string, int> values)

* public bool GetDoubleUserProperties(List<string> names, out Dictionary<string, double> values)

This does not happen anymore.



Previously, printing to PDF only supported built-in paper sizes. This has now been fixed.



Internal dependencies to Tekla.Technology.Scripting dll, Mono.Cecil.dll and DotNetKit.dll are now removed when the SetAttribute method is called for drawing plug-in objects.

The fix removes the need to deploy Tekla.Technology.Scripting dll, Mono.Cecil.dll and DotNetKit.dll with applications that are creating drawing plug-ins.


Tekla.Application.Library 2018.1.0.0. Assembly



It is now again possible to run a macro from a plug-in using the RunMacro.


Tekla.Structures.Catalog 2018.1.0.0. Assembly



It is now possible to select a component item with a defined type in Open API.

public bool Select(string name, int number, ComponentTypeEnum type)


Tekla.Structures.Model 2018.1.0.0. Assembly  



The Assembly class now supports an unlimited number of subassemblies.



The Task.GetAllTasksOfSelectedObjects() method did not work correctly and showed an assert message. This has now been fixed.



A new method, GetSimilarNumberedObjects(), for finding similar objects based on numbering has been added to the Operations class.



Creating PDF reports in Open API with CreateReportFromAll or CreateReportFromSelected resulted in the PDF file being opened automatically. This no longer happens.



It is now possible to reinforce spiral beams from Open API.



The Open API rebar selection form now works correctly with the current unit settings.



Model objects can now be selected using an Identifier constructed with the old (starting with 'ID') or new report GUID format.



Support for holes and hardstamps has been added. Previously, holes were created only if the NC File Settings dialog box was open. Now this has been fixed.



A new method to create a conical bent plate with given parameters has been added to the Operation class in the Tekla.Structures.Model.Operations-namespace.



A new method to create a conical bent plate with two radius values has been added to the Operation class in the Tekla.Structures.Model.Operations-namespace.



The 3 rebar set modifier classes, RebarSplitter, RebarEndDetailModifier and RebarPropertyModifier each have a new method named GetAffectedBars. The method returns the virtual bars in the parent RebarSet that are affected by the modifier.


Tekla.Structures.Dialog 2018.1.0.0 Assembly


Localization now works correctly if several Open API Wpf dialog boxes are opened at the same time.



Plug-ins with PluginFormBase(Forms) or PluginWindowBase(Wpf) dialog boxes can now be changed and reloaded without restarting Tekla Structures if XS_PLUGIN_DEVELOPER_MODE is set to TRUE.


Tekla.Structures.Plugins 2018.1.0.0 Assembly



XS_PLUGIN_DEVELOPER_MODE now works correctly, and it can also be used for UI development for model and drawing plug-ins. Plugin dll files must be located under (.environments\common\extensions\) subfolders

NOTE: This advanced option cannot be used with nested plugins or with plugin dll files that include static variables.

The workflow is as follows:

  1. Add “set XS_PLUGIN_DEVELOPER_MODE=true” to the teklastructures.ini file and open Tekla Structures.

  2. Run the plug-in (model or drawing), or open the plug-in dialog box from an object in the view.

  3. In Visual Studio, change the plug-in UI, build the plug-in and copy the changed dlls as a post-build event.

    1. i.e xcopy $(TargetDir)$(TargetName).dll "C:\ProgramData\Tekla Structures\Work\Environments\common\extensions\DrawingPluginDemo\" /R /Y

  4. Run the UI macro (Reloadplugins.cs) in the Applications & Components catalog in the side pane.

  5. Open the plug-in dialog box again, and see if the UI is the new one.

  6. If there is a problem in opening the dialog box after running the Reloadplugins macro, first open another plug-in dialog box with Forms and then retry.

  7. The plug-in can be debugged and changed without restarting Tekla Structures (works at least with VS2017)

  • Attach the debugger first and run the plug-in.
  • Debugging can be stopped with Detach all from the menu.
  • The code can be changed and rebuilt.
  • Debugging can be started again after Reloadplugins is executed.


Reloadplugins.cs code:

#pragma warning disable 1633 // Unrecognized #pragma directive
#pragma reference "Tekla.Macros.Akit"
#pragma reference "Tekla.Macros.Wpf.Runtime"
#pragma reference "Tekla.Macros.Runtime"
#pragma warning restore 1633 // Unrecognized #pragma directive

namespace UserMacros
   public sealed class Macro

       public static void Run(Tekla.Macros.Runtime.IMacroRuntime runtime)
           Tekla.Structures.ModelInternal.Operation.dotStartAction("dotdiaLoadDialogs", "");
           Tekla.Structures.ModelInternal.Operation.dotStartAction("dotdiaReloadDialogs", "");
           Tekla.Structures.Model.Operations.Operation.DisplayPrompt("Dialogs reloaded..");