Category: Tekla API

A series of blog posts exploring the Tekla API.  Code examples, explanations and (where relevant) videos will be provided.

  • AutoCAD-Tekla Interoperability (AutoCAD .net)

    Tekla – AutoCAD Interoperability Tool

    Tekla licenses are pricey. About $30k + maintenance per license. What if I told you that you needed 30-50% less licenses than you currently hold. That’s a huge cost saving, isn’t it?

    If you only need 5 licenses (as opposed to 10), then you’ve saved $150k instantly, plus maintenance.

    AutoCAD licenses are significantly cheaper.

    But if only the work you did in AutoCAD could be transferred into Tekla? That would save you some licenses. That’s just what I’ve done here in my latest project. Now a significant portion of any modelling job can be done in AutoCAD and simply imported into Tekla.

    You can check it out here:

    Tekla – Autocad Interop. from Tek1 on Vimeo.

    Human Resources Problem

    Interoperability will also help improve the quality of your work: it’s tough finding people who are highly skilled in Tekla. What if I told you that you could use an AutoCAD draftsperson instead of someone well versed in Tekla, to do the same job? Now you have a potentially infinite pool of candidates to draw from.

    Tools

    Click here to download

    Interested In more?

    I’d love to be able to help. Just call or email us.

    How to Download Tekla Catalogues (or Catalogs):

    You need to download the catalogue because the interop DLL connects to the catalog. Without it, we cannot verify that your profiles actually exist in Tekla.

    Here is the cataloge download link: 

    https://github.com/benkoshy/Acad-Tekla-Interop

    Trouble Shooting

    • Ensure you are using the “Steel Detailing” license.
    • Ensure you have AutoCAD 2023, or 2024. Do not use 2025 because this tends not to connect with Tekla.

  • How to insert Reference Models into Tekla

    Wouldn’t it be handy if we could pro grammatically insert reference models into Tekla? Well you can now do so quite easily. And if you want to see a video demonstration, here it is:

    Here is the code which does the hard work. (You will of course add the appropriate references and directives):

  • Adding a Dimension to a Beam – Drawing – (Tekla Open API Tutorial)

    This is an example of a hello world program which dimensions a beam. I found this code in the Tekla Drawing Samples folder.

    You can see it in action here:

    How to dimension a beam using the Tekla Open API (c#)
    How to dimension a beam using the Tekla Open API (c#)

     

    Let’s walk through it:

    1. We have to get the relevant drawing.
    2. Then we have to get the relevant part we want to dimension.
    3. Then we get the view associated with the part.
    4. We save our current transformation plane, and we set a new transformation plane to the particular view’s display coordinate system.
    5. From here, get the part’s identifier and we select the ModelObject in the model itself – to get the relevant coordinates of the Beam we want to dimension.
    6. Once we’ve used the identifier to get the Beam we are after, and to get it’s relevant parts then we create the dimension.
    7. Remember to save back the original transformation plane.
    8. Note: if you insert the dimension then I obtained an exception. I don’t think you need to insert dimensions when working on drawings.
    9. Note 2: if you forget to save the transformation plane back to the original, then you will find that you dimensions will go wacky, next time you run the command. Always remember to leave things as you found them!
    10. Note 3: You have to have the beam in the same plane as your view otherwise it won’t draw the dimension.

     

    Here is the code for your benefit:

     

     

  • Converting Engineering Components to Detailing Components

    What do we want to do?

    1. We have received a Tekla model from someone.
    2. The model we have received was built using an Engineering Modelling license.
    3. We have a full detailing license.
    4. There are components in this model, but we can’t number them because they were produced using an engineering license. If you want to number them, well they ought to have been created with a detailing license. So what do we do now?
    5. The only way to number these components is to first convert these components to a “detailing component”. The detailing component is a “type” of component.
    6. The problem is that there is no method exposed by the Tekla “Open” API which allows us to programmatically call this functionality. Also to make things more confusing: the nomenclature used in the user interface is different to the nomenclature used by the creators of the Open API.
    7. So what then is the solution?

    The Solution

    Here is a video explaining both the problem and demonstrating a solution:

     

    And here is the code which actually does the work:

     

    I hope you learned something!

  • Tekla–AutoCAD: Interoperability Tool

    Tekla – AutoCAD Interoperability Tool

    Tekla licenses are pricey. About $30k + maintenance per license. That’s expensive. And if you had 10 licenses, or perhaps even 50 licenses, what if I told you that you needed: 30-50% less licenses than you currently hold? That’s a huge cost saving. If you only need 5 licenses, then you’ve saved $150k instantly, plus maintenance. You can now do that.

    AutoCAD licenses are significantly cheaper than Tekla.

    But if only the work you did in AutoCAD could be transferred into Tekla? That would save you some licenses.

    That’s just what I’ve done here in my latest project. You can check it out here:

    Tekla – Autocad Interop. from Tek1 on Vimeo.

    Thanks for visiting this page.

  • Converting Engineering Components to Detailing Components (Tekla API)

    Has anyone every given you a  model created form an engineering license and asked you to produce shop drawings from it? Well that’s incredibly difficult to make possibly. Because you can’t easily number parts.

    So I created a macro which makes life much easier (and faster) too.

    Here is a demo of how it works:

    Tekla Macro – How to Convert Engineering Components To Detailing Components from Tek1 on Vimeo.

    I will post the code in another post.

     

  • Tekla Open API Resources

    1. The Open API Reference.

    This was produced by Trimble and is the go-to place for information about classes and methods etc. There are some code examples also given. You can download it all from here. There are some basic code examples in there which is well worth investigating.

    2. Trimble Open API Examples:

    Extremely valuable. Thank you Trimble! If you want to see older examples, you’ll have to revert to another branch in the tree.

    3. Tekla ExtraNet

    A fairly good resource, but the problem is that in order to have access there, you need to pay maintenance. Not everyone wants to do that. Plus the forum is extremely restrictive in terms of what you can and can’t post.

    4. Tek1 Blog on the API.

    There is a wealth of Tekla Open API articles and resources on this site: you can read them here. It will be growing and growing with increasingly sophisticated plug-ins and I’ll be providing the code for you in the above pages.

    5. Teklanology Blog:

    You can checkout a blog from my estimable colleague.

    And you can learn much from there. Mr Dale doesn’t post everyday, but when he does, it’s good. Here is his GitHub page as well.

    6. Software Solutions – Tekla Blog:

    This provides you with some handy code examples.

    7. Tekla Application Library

    I love to pay out Trimble for their API but I must give them credit where due – here is an application library they created. But unfortunately, the documentation is lacking. I’m convinced that if you know how to use it, it will save you time.

    8. Tekla & AutoCAD Blog

    Check it out here!

    In my opinion it is a very nice blog – but I am partial to it, I confess. Learn some powerful techniques to manipulate the API, even though certain objects/methods are not exposed – there are ways around it! If you have any more suggestions, please feel free to post them here. And I will share it to the world. [Disclosure warning: this is my personal blog 😉 ]

    9. Cad Support Blog

    Looks like quite a nice blog with a few code samples to aid in your learning.

    10. RazorCX

    These guys are good. You can learn something from them. They’ve sprung up overnight and are stealing my thunder + positing videos and code too. I better up my game!

    11. Chris Keyack Playlist

    Keyack, my estimable Tekla Open API colleague has spent time working inside Tekla itself – so I’m sure you can find many nuggets of wisdom there.

  • Showing an Assembly in the Model via a Tekla Drawing (Part I) – Tekla Open API Plugin

    I’ve created another Tekla plug in. And I’m calling it using a macro.

    What does this plug in do?

    Here is a demo:

    Basically it display an assembly in the model, from a given assembly drawing. Does that make sense? Well if not let’s elaborate:

    The Problem:

    I’m sure you’ll be having similar issues. So I’m working in Tekla. I’m busting my brains on this model that we’re working on, the boss is on my back like a monkey, and to add to all of that, I’m looking at an assembly drawing, but I have no idea how the actual drawing looks in real life. Can you make any sense of this?

    Can you make sense of this drawing? How does it look in 3d?

    This is simply an assembly drawing. Can you imagine how it would look in real life, or in the model?

    I guess not. What you want to see is the assembly in the model space. Well prior to my plug in, there’s a lot of rigormorale in finally getting to and seeing the drawing. Now you just run the macro and BOOM you can see exactly what that assembly drawing is referring to. In this case it’s referring to this lovely assembly in the model.

    Saves a lot of time and effort, hey?

    Ahh the glorious power of knowing .net and the Tekla API. Makes life a lot easier. But the hard part is learning programming,  .net, Tekla and the Tekla API. I suppose just save yourself the trouble and hire someone who already knows how!

    Where is the code?

    Please click here to access the code associated with this post.

     

    Ben Koshy

  • Create accurate grid from converted PDF Files

    This  tool works with Autocad. Usually the architects grid is not accurate to the decimal point for detailing purposes. Most detailers redraw the grid more accurately.

    This API tool let you select text in autocad and draw the grid automatically. Usually a pdf file converted to autocad is sufficient.