Split Feet and Inch in the BOM

Tekla Structures
Not version-specific
Tekla Structures
Split Feet and Inch in the BOM
feet
inch
feet inch
split feet inch
template
template editing
Template Editor
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
2016_03_27_15_06_381.png


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
2016_03_27_15_09_092.png


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
2016_03_27_15_11_323.png


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
2016_03_27_15_14_184.png


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
2016_03_27_15_20_385.png


 
Image
2016_03_27_15_20_506.png

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
2016_03_27_15_22_447.png


 
Image
2016_03_27_15_24_058.png


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
2016_03_27_15_27_119.png


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
2016_03_27_15_27_3010.png
There is 0 9/16 in the inch field, so if we don't want to see the 0 inches we can modify the template to not ouput the 0. See instructions below.

First, we need to add a hidden value field that gets the main inch value.

 
Image
2016_03_27_16_22_3111.png



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
2016_03_27_16_24_4412.png


Now, the zero should not show.

 
Image
2016_03_27_16_25_2713.png


To finish your work you need to repeat the steps to all the Length fields in the template. 

 
Image
2016_03_27_16_26_3014.png



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.

 
Was this helpful?