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.
- Get every SinglePartDrawing which name starts with “HEA/IPE/CC”
- Calculate the distance of every bolt distance from the start of the corresponding Single Part. ** This blog post will address Part II.
- Write the name of the Single Part and every bolt distance to Excel.
- 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 – simply follow the well detailed comments and it should be fairly straightforward. As always, any questions, feel free to ask.
We now have extracted the relevant information. Part III will delve into extracting this data in an Excel format. We will most likely use an OpenXML on other such library for that purpose. That post will come shortly, when I get a spare moment. Till that time, enjoy the following – or perhaps it can be left as an exercise for the user?!