Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

Options

Want to iterate through every possible configuration and then export it. (Via API or featurescript)

msystemsmsystems Member Posts: 4 PRO
edited November 2022 in General
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:
  1. 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
  2. User selectable file extension. Stl or gltf export primarily
  3. 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.

Comments

Sign In or Register to comment.