Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Adding Configuration to BOM Table

Hi Everyone!
I’m working on a part in Onshape where I have a variable input for an extrude length defined in the Part Studio. I would like to specify this length in the assembly and have it automatically appear in the BOM table. My goal is to avoid having to create a drawing just to check the length of the extrude.
Does anyone know how I can add the length of the extrude as a configuration value or custom property so that it shows up in the BOM table directly? Any help or tips would be much appreciated!
Thanks in advance!
Comments
you could use the Partname custom feature, and include the length in the partname:
https://cad.onshape.com/documents/f4d470584fdeef9603415532/v/7d0c0b30a8b73bbd6ed13b01/e/acddbbed81af3772a07adf21
Thanks for the suggestion!
I intend to define the length at the Assembly level, not at the Part Studio level, because the aluminum extrude can be used in different sizes at the Assembly level, which I cannot know when creating it at the Part Studio. Otherwise, every time I need a different size, I would have to create a new configuration in the Part Studio, which I want to eliminate.
When defining the length at the assembly level, you'll be able to call in a configurable part studio (unlimited options if you use a configuration variable for the length). It will change the length, as well as the partname in one go since it will apply the variable to all features in the tree, not just the geometry.
rightclick to 'convert to expression' on the sting/text field and input your configuration variable there. using toSring(#variable)…
in the example you'll see I used toString(#Length/millimeter) (to make it unitless), and then added the units in the third string.
@EvanReese: is there a way to make a units option in the feature? so that it'll do that for you for all 'ValueWithUnit' types?
https://cad.onshape.com/documents/c440134b177eb7d0461c0b2b/w/d9e444e9085393c16f067af4/e/2f121e3a43ec7d0196864cd8
see below the assembly on the right (BOM showing) and configurable part studio on the left.
@jelte_steur814 Thanks for the detailed explanation.
The concept you explained would not work if I wanted to have this many times in Assembly with different sizes. Below is an example of what I am looking for.
I have a Square Profile at the Part studio as a Purchase part now I want to use the part in an assembly with different sizes like 500 and 200 mm, and now how can I communicate the length through BOM? See the below images. I wanted to have the same Part Number and Name for both the parts.
if you insist on using a single part number for different length parts, be my guest.
there are 2 ways to approach this:
If you rock a pro or enterprise license, you could create a custom property, add it to the BOM and configure that in a similar custom feature as partname, but then adapted to configure the length.
else try and hack the partname feature to configure the description.
You can set any part property with this feature:
Set Property
https://forum.onshape.com/discussion/24731/set-property-new-custom-feature…
.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
@MichaelPascoe Thanks, Micheal! This is exactly what I am looking for. Can you also please share the "Add to string" Feature script, it's not available online!
.
Shared! Add to string
.
Joining strings (text) within the part studio:
For anyone else needing to add to strings within the part studio. You don't actually need a custom feature for this:
You can join strings together with the tilde symbol (~) like this directly within an input field:
"myPrefix_" ~ "OriginalString" ~ "_Suffix"
This concatenation of strings will result in this:
"myPrefix_OriginalString_Suffix"
You can do this with variables if the variable is a string:
#myVariable1 ~ "_" ~ #myVariable2
Also you can convert numbers and values with units to string like this:
toString(#myVariable1) ~ toString(#myVariable2)
.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
The Part Name feature is a bit dated now that "convert to expression" is a thing, and now that you can drag out the feature UI to make it wide so you can have a long expression in there to concatenate the strings easily. I think Michael's Set Property feature is a great way to go here.
I wish there were a tiny button for "Convert to expression" this way more people would know about it. Or perhaps it would auto convert to expression if it reads a # and then theres instead a right click option for "convert to text"
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
@Pattabi_Kakumanu You will probably want the Variable to String feature if you are trying to put a measurement into string format. It's a pain to try to round and convert values with units when using in-line featureScript. Since Onshape uses meters behind the scenes, if you try to do toString(38.8 inches) it will turn that into something like " 0.985438438541864354 meters".
Variable to String - Feature: This will take a value with units and convert it to a readable string. Example: 0.985438438541864354 meters to "38.8 in"
Really useful when turning a measured value variable into a string.
https://cad.onshape.com/documents/19dacc01596e7c326bbfb137/w/0567dd7ffac5327836c9bb93/e/cd2c8c665d8a4b00ab3…
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴