Split Feet and Inch in the BOM
Not version-specific
Tekla Structures
Environment
United States (Imperial)
United States (Metric)
Split Feet and Inch in the BOM
This article will show you how to take an existing US Imperial BOM for an assembly drawing and split the Length field to output Feet in one field and Inches in another.
How to start
Model a member that has a specific feet and inch value (i.e. 10-3 9/16 not 10-0) and create an assembly drawing of it.In the drawing, double click on the Bill of material (BOM). A dialog box opens asking you if you want to edit it. Click Yes.
Here, you need to find the style that you are using. In this example style 1 is used.
Image
Work with one line at a time. In the template, edit the existing length field to be a certain number of characters, number three is used here.
Image
Next, change the text LENGTH by clicking on it and changing the content to FT. Add a line and then add INCH by clicking the abc button.
Image
Now we have the text at the top changed and the length field in the bottom has been reduced.
Next, paste the same line we copied at the top to the bottom where we adjusted the length field to seperate the two.
Then, copy the existing three character length field and paste it to the right like in the images below.
Image
Finally, we have fully adjusted all the text and value fields to be in the right locations and line up correctly.
Now we can insert the correct formulas. See image below for guidance.
Image
Image
setat(mid(format(GetValue("LENGTH_GROSS"),"Length","ft-frac","1/16"),0,find(format(GetValue("LENGTH_GROSS"),"Length","ft-frac","1/16"),"-")-1),find(format(GetValue("LENGTH_GROSS"),"Length","ft-frac","1/16"),"-")," ")
Now we are done with the FEET field. Next, we need to add the INCH field, this formula is a little longer but the same principles apply as with the FEET field.
Image
Image
setat(mid(format(GetValue("LENGTH_GROSS"),"Length","ft-frac","1/16"),find(format(GetValue("LENGTH_GROSS"),"Length","ft-frac","1/16"),"-")+1,3),find(format(GetValue("LENGTH_GROSS"),"Length","ft-frac","1/16"),"''")," ") + setat(mid(format(GetValue("LENGTH_GROSS"),"Length","ft-frac","1/16"),find(format(GetValue("LENGTH_GROSS"),"Length","ft-frac","1/16"),"-")+3,),find(format(GetValue("LENGTH_GROSS"),"Length","ft-frac","1/16"),"''")," ")
Before we leave the value field adjust the Length of character to seven. Otherwise, there are not enough characters to output the inches.
Image
Only the main part row has now been edited, so the rest of the rows have to be edited to match.
Nonetheless, you can already test it to see the output. Save the template, reopen your drawing and go to the bill of material.
Image
First, we need to add a hidden value field that gets the main inch value.
Image
Now that we have the hidden field that will do the math for us we will use that field in the Inch output value field:
Image
Now, the zero should not show.
Image
To finish your work you need to repeat the steps to all the Length fields in the template.
Image
Once you are done be sure to save your template in a firm folder so when you update your service release or version you do not lose your work.
If you need help setting up your firm folder you can visit our article Basic Firm and Project Folders.