Automatic Part Number Generation

Automatic Part Number Generation

A new feature enables Ciiva to automatically generate a new base component part number when a component library entry is being manually created or an existing one cloned (note that this feature is not yet support by the importer, this will be done at a later stage).

A formula which is defined in the user settings allows customers to define how the part number should be generated. The formula is made up of “tags” and “constants”. Tags are resolved based on “tokens” which describe what the tag expression should evaluate to. Constants are simply fixed characters or strings that are include in the part number verbatim.

To modify the formula, open the user settings and select the “Auto Part Number Generation” tab.

Auto Part Number Generation

The page is split into three sections. The first provides a quick reference for tag and token syntax giving some examples. The button “Create Example Formula” will build a formula from some common tags, tokens and constants and populate it in the “Base component part number formula” field.

The second section contains the “Base component part number formula” which can be manually edited to include tags, tokens and constants which define how the part number will be generated. The field “Example base component part number” shows an example of how the generated part number may look (note that if you specific attribute tokens, e.g. “type”, in the formula which do not have a default value, they may appear empty in the example).

In the last section, error information relating to problems that were encountered parsing the formula (e.g. due to invalid tokens, etc.) will be shown.

Let’s take the example formula that is generated from the “Create Example Formula” button:


“Tokens” are the content that is define inside a “Tag”, which is all of the content enclosed within curly braces. Valid tokens are described in the formula definition help section. In this example, the first tag contains three tokens. Tokens are separated by colons. Let’s take a look at these in turn:


This is the name of a base component attribute which will be evaluated and substituted with the value for the attribute, e.g. “Capacitor”


This tells the generator to convert the value that was obtained for the attribute value class to upper case, e.g. “CAPACITOR”


This tells the generator to take only the first 3 characters from the value, e.g. “CAP”.

The constant “-“ between the first and second tags is then appended to create the separator. Let’s look at the second tag:

When you use attributes that are enum types, you can access to properties, “id” and “pk”, which are numerical representations of the value. The “id” is fixed and will not change for an enumeration value even if you change this enumeration value (e.g. if you changed the enum value from “Capacitor” to “Capacitor2”, the “id” would remain the same). Conversely, the “pk” value is unique to the enum value and will change if you redefine the enum value. In this example, the “id” value is “1”.


This tells the generator to normalise (or pad) the number to be a fixed number of characters. In this example, this pads the “1” to become “0001”

In the final tag, we use the term “autoinc” to define a number that will be automatically incremented when the part number that is to be generated already exists. The “s5000” tells the generated to start the auto increment value at 5000, and the “n8” tells it to pad it out to 8 characters, resulting in the value “00005000” in the example.

When you have made changes to the formula definition, don’t forget to save the changes:

Auto Part Number Generation

Part numbers are currently only generated for base component library entries that are made through the right-click “Create Base Component” menu option:

Auto Part Number Generation

Or “Clone Base Component” menu option:

Auto Part Number Generation

In future, the importer will also support automatically generating base component part numbers.

A value for the part number will be dynamically calculated based on the defined formula:

Auto Part Number Generation

As changes are made to the attribute values which are included in the formula, then the part number will be automatically updated with a new value:

Auto Part Number Generation

Auto Part Number Generation

Auto Part Number Generation


You are reporting an issue with the following selected text and/or image within the active document: