Automated Part Number Featurescript

I’ve put together a featurescript for Onshape to automate part numbering, saving you the hassle of going in and individually numbering each one.


It currently features support for the 254/1678 naming system (TEAM-YEAR-P-[ASSEMBLY][PART]) and the 971 system (TEAM-IDENTIFIER-ACRONYM-SUBASSEMBLY-PART). The link can be found here.

All feedback and feature requests are much appreciated!

15 Likes

Probably will play with it tonight— any chance you can have an option to use the Part Number field in the part properties instead of or in addition to renaming the part?

1 Like

This would be fantastic.

Yeah, that would be a great feature. I was just playing with it and found that, if the user renames a part to their own custom name, no feature script can edit that name. Changing the part number instead would be much more preferable.

Yeah absolutely, especially since the part number field is really where that information “should” be, since it lets you also have a descriptive part name while making the P/N play nicely with the BOM and drawing features.

I love how we’re at the point of re-engineering enterprise-only features in Featurescripts. This is why OnShape is awesome.

7 Likes

V7 out now with automatically set part number, and a checkbox to edit the part name as well. Right now it doesn’t have an option to only change part name, as I figured that would just complicate the UI, but if anyone wants it I can certainly add that functionality.

3 Likes

I’ve added the ability to start at a user-defined part number instead of always starting at 1, so you can do this multiple times for different batches of parts without it re-starting the entire sequence of numbers. Thank you @dydx for the suggestion!

2 Likes

v10 is now out, with 1885/469 ([ACRONYM]-[ASSEMBLY NUMBER]-[PART NUMBER]) and 'Snow Problem([ASSEMBLY NUMBER][PART NUMBER]) Naming
image

3 Likes

Just updated it to support 4414 naming ([MANUFACTURING PREFIX]-[ASSEMBLY NUMBER]-[PART NUMBER]). Since this system has independent numbering for each prefix(so that milled parts are separate from lasered parts for more organization while making the parts) , you have to run it separately for each prefix.

3 Likes

We don’t use Onshape but have implemented similar features in Inventor and really like the results. We have a more simplified system of ‘team number’ - ‘year’ - ‘4 digit number’ for all of our custom parts and assemblies. for COTS parts they all get a ‘supplier’ , ‘manually entered part number’ name.
Really cool that you can implement these kind of features in Onshape yourself.

Might be easier to somehow denote the format of the numbering system in the name instead of the original team that used it.

3 Likes

I was considering that, but actually denoting the format can get kind of long, especially with the variations in information used (i.e. 4414 uses identifiers for manufacturing). Maybe making a document that has overviews of each system?

You could include that document as a link tab or PDF in your featurescript document.

I think I might make it more parametric, instead of having options for each subsystem

1 Like

image
This is what it looks like currently, I’m going to try and make it so that all of this information can be selectively included, for more adaptability

3 Likes

Version 16 is out, with parametric part numbering. Here’s how it works:

The featurescript makes use of an Array parameter, which allows you to specify the individual elements you’re adding to your part number format. There are a few options, along with a “Custom” option, but those are more for clarity than anything else(more on that in a bit). You can add as many parameters as you want, and add a suffix to each (like “-”).

image

In addition, you can choose to place your actual part number in between other elements, by adding a “Part Number” parameter, in which case the value field isn’t used, and is replaced by the individual number of each part.

image

If you don’t add the part number as an identifier, it’ll just be tacked on to the end of each part.
There are also a few options at the bottom, including the option to format single-digit part numbers as 2-digit (i.e. “01” instead of “1”), the option to start at an arbitrary part number, and the option to name your parts alongside numbering them.

8 Likes

very cool! now I never have to induvidually number each part again!

2 Likes

I may or may not have made this featurescript specifically so you don’t have an excuse for not numbering your parts

7 Likes