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.
assembly configuration list variables/ derived variables from configuration variables

Hello,
Some time ago, I needed tot explore the possibilities of configurations for design automation.
I remember there were still some hurdles to overcome to get it working in our specific setup, as of today I still couldn't make it work. I need to train other designers and I would like to make is as "automatic" as possible.
Tha main problems were
- configuration list variables couldn't be accessed as a variable
- configuration variables can't be used to derive/ calculate a new variable
allthough visibility of parameters can in the mpean time be modified based on other parameters apparently; variables still can't be made dependend of other variables… (ternary operators are very messy and become difficult to manage, especcially once the list gets longer… (only 3 instances as an example here,)
Probably there are better ways to achieve what I need, any advice would be greatly appreiated.
Ive included a simple example to explain the issue.
configuration variables test | Assembly 1 (onshape.com)
1, 2 or 3 bricks can be placed next to eachother, (each can vary in length, chosen out a set of dicrete values (picklist) ideally, bricks can be added indefinitely, but I can work around it by defining a big enough amount for now..
upon this first layer of bricks a second layer needs to be placed, evenly distributed along the total length of the bottom layer.
basically I need to calculate the total length based on the occurance and length of the bricks in the bottom layer; divided by the number of bricks in the second layer…
I can't get it to work without manually setting the total length.
I need this to be done in assembly (because I need the BOM functionality, which is not available in part studio)
thanks!
Answers
I'm replying on mobile so I haven't looked at your document but two things occur to me:
Hope these help, I think this problem is surmountable with current functionality.
Hi Sasha,
Thanks for the tips. Unfortunately none of those work in assembly studio as there is no feature script available there. and part studio doesn't provide a way to generate BOM lists. Or am I getting this wrong?
There is a way through variable studio's.
https://cad.onshape.com/documents/729bcc8f583ecbc9006f898f/w/ee43aa8b0244c5c5a37603d8/e/186824b3cc7604cffdb653d2?renderMode=0&uiState=67adc682ac3f7f77d7e54a87
Here's a first basic try to make Total length and length_brick driven fully driven.
changing the length is done in the variable studio i.s.o. in the assembly.
I'm afraid there's no way of making this work through lists, or limit the values like in normal parameters?
It should be possible with logic to make total length driven by nr_part_layer1 as well. but there will be a limit since the X number of Length_part_X variables need to be created first.
the BOM will be sorted by brick lenght in this way of working.
This logic will do the trick.
Total_length and in assembly the 2nd and 3rd instance of the part1 are now driven by their Lx_if parameter. if its length turns to 0, the part fails.
FYI i'm using this syntax from FS in the parameter value:
logical_test ? value_if_true : value_if_false
it will also allow arrays which may come in handy sometimes…
not very sofisticated, but it does the job. since I can't figure out a way to make the supression of the 3rd instance of part1 dependent on nr_Part_layer1.
A similar P3_present_if 'any' parameter could turn true/false, but there's no way of driving part/assembly from there…
Thanks!
elegant solution. Is there a way to drive this from a configuration (list) or variable? I guess you must populate this list for each possible brick that goes on the bottom layer (eg to a maximum of 10 bricks) or can this be set up dynamically.