Extracting Bolt Distances From Single Part Drawing Files With an Output In Excel – Part 1 (Tekla Open API)

Posted on Posted in .net (c#), Tekla API
We want the bolt distances of all the single parts.
We want the bolt distances of all the single parts.

Every now and again we obtain a request from our readership to tackle a problem. If it is of general interest to the public and given our commitments we do sometimes oblige. Here is one such interesting problem. We will tackle this in three parts, and will focus on part 1 in this blog post.

  1. Get every SinglePartDrawing which name starts with “HEA/IPE/CC”
  2. Calculate the distance of every bolt distance from the start of the corresponding Single Part.
  3. Write the name of the Single Part and every bolt distance to Excel.
  4. Refactor the code.

The first part is easy enough – and the code is pretty self-explanatory. We want to iterate through all the drawings and filter for the specific drawings that we are after.

Here is the code:

In the next part, we will look at obtaining the relevant parts that we want and calculating the bolt distances from the start and end points. And finally, we will look at refactoring the code, because it is a little slow, and also from a maintainability point of view.


An Addendum

  • I was simply following the instructions of the question without inquiring too far into its purpose. If you actually want to extract NC information via the API – Tekla can very easily do this. But that was not the scope of this particular task – it was to deliver a very specific and peculiar set of requirements to a particular reader, but it is a topic which will be of general import to the public.

Leave a Reply

Your email address will not be published. Required fields are marked *