Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Part Numbering based on multiple attribute values


Part Numbering based on multiple attribute values

How to set a different number sequence based on multiple attribute values in Windchill PDMLink


Attribute 1: A , B , C

Attribute 2: 1, 2, 3

Attribute 3: X, Y, Z


Combination will be like











Sample schema should be like:

A1X001, A1X002, A1X003,......

A1Y001, A1Y002, A1Y003,......

A1Z001, A1Z002, A1Z003,......

A2X001, A2X002, A2X003,......

A2Y001, A2Y002, A2Z003,.....

A2Z001, A2Z002, A2Z003,.....

23-Emerald II

A better explanation of what you are trying to do with that numbering scheme would help.

What defines when to use a different sequence?

Are you using auto-numbering?  There is an issue with that, it causes numbers to be skipped in certain instances.


It is a requirement from client.

Different schema based on the combination(or concatenation) of 3 attributes together. 

3 digit autonumbering at the end of the combination.

No numbers to be skipped.

23-Emerald IV

No numbers to be skipped.

If this is tied to Windchill auto-numbering, some numbers *WILL* end up getting skipped.  The only way to avoid this is to develop your own custom code.  I imagine it would have to keep track of when numbers are assigned as well as handle cases where an assigned number ends up not being used (so it can be reused again.)

23-Emerald II

Since the file number is entered (or generated) prior to the user entering any attributes (parameters) this would require some custom code to build your part number.  As Tom said, using auto-numbering with the FDB sequence numbering in Windchill WILL cause number skips.

Your best bet would be to create an external program that asks the user questions about what they are doing to define the 2 attributes with the 3rd number being sequential, then store the results in a file for the next seed number of each type.

I don't know enough about what is available in writing custom code into Creo. When I used Unigraphics, we had GRIP programs that could be plugged into the code to replace certain functions with custom code. One of those places was in the File New command. Our users were presented with a menu choice for what type of file they were creating and then the program would assign the next available part number from a seed number of the prior number. The result was uploaded to the file for the next use along with some additional information, like user name, date and in our case drawing size selected. UG at that time did the drawing in the same file as the model.

5-Regular Member

A way to combine several attributes and several counters avoiding heavy customizations is by:

1. Adding counters in the database

2. Adding the attributes to OIR

3. Codding the logics into OIR


1. Adding counters in the database (MSQL) - Windchill Database: wcDatabase, Counter: counter1:

CREATE TABLE [wcDatabase].[counter1_seq]([dummy] [char](1) NULL,[value] [bigint] IDENTITY(1,1) NOT NULL) ON [PRIMARY] GO CREATE PROCEDURE [wcDatabase].[wt_get_next_sequence_counter1_seq] @returnValue BIGINT OUTPUT AS INSERT counter1_seq (dummy) VALUES ('x') SELECT @returnValue = SCOPE_IDENTITY() GO


2. Adding attributes to OIR, in site,xconf:

<Property name="COM.myOrg.objectSubType" overridable="true"
value="attribute1, Attribute2"/>


3. Codding the logics, in the OIR of the sub-type:

<VarDef id="counterVariable" algorithm="wt.rule.algorithm.StringConstant">
<Value algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator">

<AttrValue id="number" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator">
<Attr id="attribute1"/>
<Attr id="attribute2"/>
<Attr id="attribute3"/>

<!-- the sequence -->

<VarRef id="counterVariable"/>

Top Tags