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.
Serialization
tyler_pope
Member, Developers Posts: 21 PRO
We have a request to 3D print up to 4000 parts that require serialization. Is it possible to write a script that will change the text on a extrude cut and export a stl file so they don't have to be edited and saved individually?
Tagged:
0
Best Answers
-
kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565Yep. Since your request involves exporting, FeatureScript can't do it. Custom features are have no side effects outside the Part Studio they are in.
For a task the best and most correct approach is to use the API to make the appropriate modifications.
However, here's a hackish workaround using Onshape's (very powerful) feature pattern. This solution creates many parts in the same Part Studio (which can be downloaded as one zip file with a bunch of STLs). This will likely run into the performance limits of a single Part Studio, meaning if it works at all, you'll need to break it up into several batches. However, if you're willing to deal with that, that process may be much less work than writing an app to do this work.
https://cad.onshape.com/documents/0ca7d59b7b8e1a3b9b43c377/w/313802fcead77ad82c7ddc7a/e/3c9dd7a22828473b91624b24
5 -
kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565My mistake! The document is now public.
https://cad.onshape.com/documents/0ca7d59b7b8e1a3b9b43c377/v/19e07558a08ec5ac58aa7a5c/e/3c9dd7a22828473b91624b24
5
Answers
We cannot currenetly drive text directly from a variable (we will at some point @ilya_baran) so we will need a different method.
No doubt someone what has thought about this more than me will come up with a better solution, but until then . . . .
You will need to model or derive into your part studio solid representations of the numerals 0-9 in each of 4 positions (allowing for serialization of up to 10,000 parts).
Through the API, you would drive the suppression state of the 40 parts representing the numerals (36 suppressed at any one time).
The program/web-service would then perform the boolean subtract between the parts and the unsuppressed numerals and then output the STL. Repeat.
is this the best way - I don't know! Lots of smart people here
For a task the best and most correct approach is to use the API to make the appropriate modifications.
However, here's a hackish workaround using Onshape's (very powerful) feature pattern. This solution creates many parts in the same Part Studio (which can be downloaded as one zip file with a bunch of STLs). This will likely run into the performance limits of a single Part Studio, meaning if it works at all, you'll need to break it up into several batches. However, if you're willing to deal with that, that process may be much less work than writing an app to do this work.
https://cad.onshape.com/documents/0ca7d59b7b8e1a3b9b43c377/w/313802fcead77ad82c7ddc7a/e/3c9dd7a22828473b91624b24
Stand by
P
Thanks
https://cad.onshape.com/documents/0ca7d59b7b8e1a3b9b43c377/v/19e07558a08ec5ac58aa7a5c/e/3c9dd7a22828473b91624b24
Edit: Okay, it does, as long as I set the Linear Pattern offset to zero. This feels like a misfeature, but I get the results, so okay and thanks.