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.
Want to iterate through every possible configuration and then export it. (Via API or featurescript)
I'm looking for featurescript or api code that can iterate through every possible configuration in an Assembly and export all the parts. Is it possible?
I already have featurescript that will name the parts on a human readable scheme, so they will have unique names as their properties change. Therefore the filenames won't be in conflict.
All that is left to do is automate the export process. I'm assuming that each export is a single action (api call), so it would need to pause and wait a bit between each api command for the data to come through.
Extra features that would be really useful, beyond the basic iteration:
If anyone has done something like this I'd be really interested if you could share how to do it. Or if you know your way around the API and would be interested in this gig as a paid job please leave your info. Thanks
In terms of how its implemented, it really doesn't matter to me how it's done on the back end. I currently have a digital ocean droplet running node.js for now, which I was using to run sample API code.
I already have featurescript that will name the parts on a human readable scheme, so they will have unique names as their properties change. Therefore the filenames won't be in conflict.
All that is left to do is automate the export process. I'm assuming that each export is a single action (api call), so it would need to pause and wait a bit between each api command for the data to come through.
Extra features that would be really useful, beyond the basic iteration:
- Some kind of folder structure, so each folder contains all the parts for a given configuration and they aren't just dumped to the same root folder
- User selectable file extension. Stl or gltf export primarily
- Conditional logic to check for whether an optional "Ignore" flag (string variable) is set for each given configuration row. If it finds the Ignore flag=true, then it skips over the the configuration without being exported. The ignore flag is needed for complex assemblies to reduce the number of possible configurations (in the hundreds of thousands) to a more reasonable amount, like a few hundred.
If anyone has done something like this I'd be really interested if you could share how to do it. Or if you know your way around the API and would be interested in this gig as a paid job please leave your info. Thanks
In terms of how its implemented, it really doesn't matter to me how it's done on the back end. I currently have a digital ocean droplet running node.js for now, which I was using to run sample API code.
0
Comments
This should be possible. I'll see if @caden_armstrong has any input.
CADSharp specializes in automation via custom features and api.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Feel free to send me an email and we can discuss further:
caden@cadsharp.com