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.
How can I change the BOM behavior of an assembly through the API?
Michael_Ursuliak
Member Posts: 14 ✭
I have a lot of drawings from my top assembly, I am kind of new to this API thing.
I would like to get a list of assemblies from the top assembly, use that list to go to the respective studios,
and then change the BOM behavior to Components only.
Is there a way that i can do this with the API?
I took a look through glassworks but i admit that i don't understand much of it.
I would like to get a list of assemblies from the top assembly, use that list to go to the respective studios,
and then change the BOM behavior to Components only.
Is there a way that i can do this with the API?
I took a look through glassworks but i admit that i don't understand much of it.
Tagged:
0
Answers
/assemblies/d/{did}/{wvm}/{wvmid}/e/{eid}
In the assembly definition, the field "subassemblies" gives a list of each subassembly.
Each subassembly has a documentId, documentVersion, and elementId.
These three fields will locate the assembly studio of each subassembly.
You can then use the endpoint
/metadata/d/{did}/wvm}/{wvmid}/e/{eid}
to update the metadata property for subassembly bom behaviour.
With a body similar to (replace href with your document href):
Luckily, this field is editable in versions, so you can update the field without having to find the workspace and create a new version.
The values are 0,1,2, where 0 is assembly and components, 1 is assembly, 2 is components.