1 - Introduction To API
1 - Introduction To API
Agenda
§ What is the API
§ Key areas of the API
§ Examples of tools utilizing the key areas
§ How can you utilize the API
§ Strategy to start
§ What are hardware and software needs
§ Drawing API
Create and modify drawings and drawing
Plug-in
objects API
§ Plug-in API
Create intelligent objects in the model
11 10/9/2017
12 Tekla Open API: Overview & Getting Started
Tekla Open API - Macros Macro
API
13 10/9/2017
This is what the Model Macro Looks Like
§ Record a macro from the Advanced Features option in the
Applications & components catalog.
§ Select the macro, right-click, select Edit in the context menu.
14 10/9/2017
This is what the Drawing Macro Looks Like
§ Record a macro from the Advanced Features option in the
Applications & components catalog.
§ Select the macro, right-click, select Edit in the context menu.
15 10/9/2017
Macros Example “Swap Handles”
18 10/9/2017
Structure of the Model API
using System;
using Tekla.Structures.Model; Model Tekla Drawing
API Structures API
using Tekla.Structures.Geometry3d;
namespace ConsoleApplication1
{
class Program Plug-in
API
{
static void Main(string[] args)
{
Model myModel = new Model();
Beam myBeam = new Beam();
myBeam.StartPoint = new Point( 0.0, 0.0, 0.0);
myBeam.EndPoint = new Point( 1000.0, 0.0, 0.0);
myBeam.Profile.ProfileString = "L45*45*9";
myBeam.Insert();
myModel.CommitChanges();
}
}
}
20 10/9/2017
RFI Manager
§ Manage RFI’s and link them with the model.
– Link to IFC reference model objects as well as native objects
– Colorize model based of RFI status
– Automatically check for overdue status
– Publish to HTML or FTP site or zip up and email
26 10/9/2017
Tekla Open API - Drawing
§ Drawing API
– Access the drawing list.
– Create, modify and delete.
§ GA drawings and views in any drawing.
§ Dimensions, text and other basic objects.
– Interact with the user.
§ Get currently selected drawing objects.
§ Prompt user to pick objects and locations.
§ Select and highlight objects for the user.
– Access model objects from the drawing.
§ Select the parts found in a drawing in the model.
27 10/9/2017
How a Plug-in is Structured
§ New Plug-in/connection started
– Constructor method runs
– Input prompted from user
§ Applied values taken from dialog
§ Plug-in Run() when input complete
– Both the StructuresData and the Input are stored to the
model database
40 10/9/2017
Hardware and Software Needs
§ Tekla Structures
§ Windows 7, 8.1, 10
§ .NET Framework 4.5
§ Visual Studio 2015 Professional
§ Pick a Language (Suggest C#)
§ Tutorial Material
– Videos, YouTube
– Books
§ Download Startup Package from warehouse
– Search “Open API”