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 a configurable number of sub-assemblies to an assembly

Hi Everyone,
I'm on week 2 of Onshape and really enjoying it!
I have an assembly (let's call it a ring) that has a configuration variable called "id". Based on that id input it generates a ring of a specified radius with the formula radius = 50mm + 50mm * (id - 1).
I have a second assembly (let's call it platter) that includes a series of these rings, with ids going from 1 up to N. The rings are all concentric.
I'd like N to be a configuration variable of the platter assembly, but I'm unable to find a way to programmatically add a variable number of sub-assemblies. Right now I'm just manually adding sub-assemblies and setting the ID in each one, and then manually mating. I'd like to do a variable number of rings, somewhere between 1 and 100, which is why I was hoping to not do them all manually.
I've looked into FeatureScript but it seems like it's more for the generation of a part than an assembly. If there are other programmatic ways of driving Onshape I'm happy to learn them. I did see some feature requests for AssemblyScript but it seems that's not a thing yet.
Is this sort of thing possible in Onshape? If not, does anyone have any suggestions for workarounds?
Thanks!
Answers
if it were just adding the nr of sub-assemblies, it might be doable (a circular pattern with the axis in the centre of the ring and a configurable instance count could do this). this only works for rings or other rotaionally symmetric parts though because the angle has to be greater than 0, so they'll be rotated relative to each other.
But if you want every ring to be of a different id, it's going to be a whole lot more difficult.
What's stopping you from making this in a part studio (since all rings have different size, you might as well), and then making an assembly that just loads the whole studio?
Hello! Thank you for your response :)
As for making this in a part studio, what I believe is stopping me is that each ring is actually an assembly comprised of a circular pattern of other sub-assemblies. There's an arc assembly, and then ring is made up of a circular pattern of arcs, and then platter is made up of a bunch of rings.
But perhaps I'm misunderstanding your suggestion?
You might get more insight if you can share a link to a public document, if you can.