Extracting Bolt Distances of Single Part Drawing (Beams) With an Output In Excel – Part 2 (Tekla Open API)

_config.yml

In the last part, we left off having collected the relevant Single Part Drawings that we were after. Hopefully we have applied the correct property to filter out the ‘HEA’, ‘IPE’ and ‘CC’ drawings. We will now focus on part II – extracting the distance of the bolts from the beam’s start position.

  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. ** This blog post will address Part II.
  3. Write the name of the Single Part and every bolt distance to Excel.
  4. Refactor the code.

I did refactor the code a little bit, so it might not look exactly the same as the last version. The code is pretty self explanatory. But you will note that:

  • I am projecting the bolt positions along the beam’s vector (defined from the start to end point of the beam).
  • Therefore we do not need to save and set the transformation plane.
  • A corollary (and potentially unintended consequence) is that this will capture the bolt positions of all bolts, no matter if they are on the flange of the beam, or on the web etc. This may have some unintended consequences. Again, caveat emptor – programmer beware!

Here is the code in all it’s glory – simple follow the well detailed comments and it should be fairly straightforward.

Written on November 28, 2017