tekla open api

15
Tekla Open API Introduction to the Tekla Open API Christopher Keyack – Solutions Team Manager

Upload: craciun-paul

Post on 18-Jan-2016

569 views

Category:

Documents


11 download

DESCRIPTION

tekla

TRANSCRIPT

Page 1: Tekla Open API

Tekla Open API

Introduction to the Tekla Open API

Christopher Keyack – Solutions Team Manager

Page 2: Tekla Open API

AgendaDefine the Tekla Open APIWhat you need to get startedHow to get to the APIWhere to go to get helpTekla ExtensionsRecord a simple macroQuestions and answers

[Date]

2

Page 3: Tekla Open API

What is the Tekla Open API?API = Application Programming Interface.Customization of Tekla Structures without having tochange the core.Utilizing Industry standard Microsoft .NET technology.Creates a competitive advantage at lower cost.

[Date]

3

Page 4: Tekla Open API

What is the Tekla Open API?

[Date]

4

Recorded scripts calling commands in theTekla Structures interface for Model andDrawings. (C#, API Library can be used here)

Tools that connect and interact with Tekla Structures

Parametric, run inside Tekla Structures, fast.

Create, Modify, Delete,Extract Information,Set User Attributes,

Navigate, Call Macros.

(*.exe)

(*.dll)

(*.cs)

Page 5: Tekla Open API

What do you need?Tekla StructuresWindows XP, Vista, or 7.NET Framework 4.0Visual Studio 2010 Express (Free)Pick a Language (Suggest C#)Tutorial Material– Videos, Youtube– Books

Download Startup Package fromextranet.– Product>Open API

[Date]

5

Page 6: Tekla Open API

Where is the API?Included inside your Tekla Structures Installation

[Date]

6

Tools>Macros

XS_MACRO_DIRECTORYC:\ProgramData\Tekla

Structures\17.0\environments\usimp\us_common\macros\

modeling ordrawings

• Tekla.Structures.dll• Tekla.Structures.Model.dll• Tekla.Structures.Drawing.dll

C:\Program Files\Tekla Structures\17.0\nt\bin\plugins

• Tekla.Structures.Dialog

• Tekla.Structures.Datatype

• Tekla.Structures.Plugins

• Tekla.Structures.Catalogs

• Tekla.Structures.Analysis

Page 7: Tekla Open API

Where to go to get HelpTekla Extranet Discussion Forums is the primary channel

[Date]

7

Page 8: Tekla Open API

Tekla ExtensionsDownload, Rate, and Comment on the Tekla Extranet

[Date]

8

Page 9: Tekla Open API

Let’s Record a Model MacroSave away an object representationstatus that you typically use.

Tools>Macros.

Type in a macro name like“Color_ThisStatus”.

Press “Record”.

Load Object Representation dialogbox, your saved settings, then modify.

Cancel the object rep dialog box.

Press “Stop” on the Macro Dialog box.

“Run” will run the macro you recorded.[Date]

9

Page 10: Tekla Open API

This is what the Model Macro Looks LikeSelect the macro, and press the Edit button in theTools>Macros dialog box.

10

Page 11: Tekla Open API

Let’s Record a Drawing MacroSelect a Part Mark in Drawing.

Tools>Macros.

Type in a macro name like “Add CTRDSuffix”.

Press “Record”.

Open part mark properties.

Add text field of “(CTR’D)” to Elementsin Part Mark dialog.

Press Modify, then Cancel on the PartMark Dialog.

Press “Stop” on the Macro Dialog box.

“Run” will run the macro you recorded.[Date]

11

Page 12: Tekla Open API

This is what the Drawing Macro Looks LikeSelect the macro, and press the Edit button in theTools>Macros dialog box.

12

Page 13: Tekla Open API

Make a Toolbar Icon for your MacroBitmap with same name insame directory where *.csmacro file is.

– XS_MACRO_DIRECTORYC:\ProgramData\TeklaStructures\17.0\environments\usimp\us_common\macros\modeling or drawings

– Size should be 16x16 pixels

If you use large icons, thenalso create a bitmap with“macro name_big.bmp”

– Size should be 24x24 pixels

Tools>Customize– Create a user defined

toolbar, add your macros. 13Note: May need to reopen Tekla Structures to see icons

Note: to create drawingmacro toolbars, thetoolbar has to becreated in the model sothe macros and bitmapsneed to be in both themodeling and drawingsfolder.

Page 14: Tekla Open API

Hints and Tips with MacrosCan’t record picking points, parts, or locations on the screen.

Record Macros by activating commands primarily from the menu structure ortoolbars not the right click menu in the model.

Have objects selected first if going to modify or do something to them.

Select Filtered objects using Edit>Select All Objects in the Model.

Use System.Windows.Forms.MessageBox.Show(“Your Text”); to pause yourmacro and wait for a user to do something.

Recorded macro lines can’t be directly used inside external application code.

Macro can be called inside of a Tekla External Application but not inside pluginsTekla.Structures.Model.Operations.Operation.RunMacro(“MacroName.cs”); usethe *.Operation.IsMacroRunning(); Method to check if a macro has completed.

Tekla API Library code that you use in External applications can be used insideof macros.

14

Page 15: Tekla Open API

15

Thank You

Questions and Answers