Tekla uses a variety of programming languages for its customization and development, with C# being the primary language for the Tekla Open API. The platform also supports other languages for specific applications, including Python and visual scripting languages. The Tekla software's core functionality is built on the Microsoft .NET framework.
C# is the core development language
The Tekla Open API, which is used to develop custom applications, plugins, and macros for Tekla Structures, is based on the Microsoft .NET Framework. This makes C# the main programming language for in-depth Tekla development.
- Plugins and applications: Developers use Microsoft Visual Studio and C# to create powerful extensions that add new functionalities, create custom connections, and generate complex geometries.
- Macros: Macros, which are C# source files (
.cs), can be recorded from user actions or written manually to automate repetitive tasks. When run, they are compiled on the fly.
Python offers simplified scripting
For those who prefer a more streamlined scripting experience, Python can be used to interact with the Tekla Open API.
- PyTekla: This Python library acts as a wrapper around the Tekla Open API, providing a more "Pythonic" and user-friendly way to automate tasks and work with Tekla model objects.
- Python.NET: Developers can also use the Python.NET library to directly access the .NET classes and methods of the Tekla Open API from Python. This allows access to Python's extensive ecosystem of libraries, such as NumPy and pandas, for advanced data manipulation and analysis.
Visual scripting with Grasshopper
Tekla also supports visual scripting, a paradigm where users create programs by connecting graphical blocks rather than writing code.
- Grasshopper: Through integrations with the Rhino/Grasshopper platform, both Tekla Structures and Tekla Structural Designer offer powerful visual scripting capabilities. This allows users to create custom components and automate modeling workflows without writing traditional code.
- Computational design: The use of Grasshopper opens up the world of computational design, allowing for the generation of complex and parametric models.
Other supported languages
In addition to the primary languages, Tekla’s various APIs and tools support other options.
- Tekla Tedds API: This API, which integrates with Tekla Tedds for engineering calculations, supports any Windows programming language that works with the Component Object Model (COM), including C++, C#, Visual Basic .NET, and VBA.
- Tekla Structural Designer Remoting API: This API, used for extracting information from Tekla Structural Designer models, is a .NET standard DLL and is compatible with languages like C++, C#, F#, and IronPython.
How to choose the right approach
The best language for working with Tekla depends on the user's goals and programming experience:
- For robust, full-featured applications and extensions, C# with Visual Studio is the standard, most powerful option, offering complete access to the Tekla Open API.
- For automating repetitive tasks with a simpler, more accessible language, Python is an excellent choice, leveraging the PyTekla or Python.NET libraries.
- For generative design and complex parametric modeling without writing traditional code, Grasshopper visual scripting is the ideal solution.
- For integrating with legacy systems or specific applications, languages supported by the COM architecture, such as VBA, can be used via the Tekla Tedds API.