01 introduction to the tekla open api

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

Upload: craciun-paul

Post on 21-Nov-2015

490 views

Category:

Documents


16 download

DESCRIPTION

Tekla Open Api

TRANSCRIPT

  • Tekla Open API

    Introduction to the Tekla Open API

    Christopher Keyack Solutions Team Manager

  • 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

  • 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

  • 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)

  • 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

  • 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

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

    [Date]

    7

  • Tekla ExtensionsDownload, Rate, and Comment on the Tekla Extranet

    [Date]

    8

  • Lets Record a Model MacroSave away an object representationstatus that you typically use.

    Tools>Macros.

    Type in a macro name likeColor_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

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

    10

  • Lets 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 (CTRD) 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

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

    12

  • 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 withmacro 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.

  • Hints and Tips with MacrosCant 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 cant 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

  • 15

    Thank You

    Questions and Answers