Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hello everyone,
I'm currently working on implementing an auto-naming system for parts and assemblies in Creo Parametric. My goal is to have the name generated based on a combination of a unique identifier and the type of part (Mechanical, Electrical, etc.). The idea is to have a function like this:
new_name = "PART_" + TYPE_SELECTION + "_" + UNIQUE_ID
For the TYPE_SELECTION, I want to create a dropdown list of options, and for UNIQUE_ID, I'm looking for a way to make it increment by 1 automatically each time a new part is created.
I was able to add basic parameters via Tools > Parameters, but I'm not quite sure how to make TYPE_SELECTION a list of predefined options or how to auto-increment UNIQUE_ID.
Does anyone have experience setting up something similar? Any guidance or tips would be greatly appreciated!
Hi,
from my point of view auto-naming system for parts and assemblies is system which assign names to files. If you want to implement this functionality, you have to develop Toolkit application which calls generator and them creates part or assembly.
EDIT: That's just for parameters, though. To implement that as a naming scheme in Windchill, I think it's doable, but I've never done that myself. See this link:
I have done it, but not actually use it.
To make a drop down list of options, there are two methods.
1. Using .lst file
Example:
ND_ParamDefArr_K01 = {
{ Name = Maker
Type = string
Default = 'ミスミ'
Enum = { 'ミスミ', 'SMC', 'キーエンス', 'CKD', 'IAI', 'オリエンタル', 'オムロン', 'コガネイ', 'THK', 'CSS', 'SUS', 'ユーザ入力'}
}
}
2. Using user interface
Automatic numbering can be achieved with Creo API, or automation script (eg. python).
You should use what you are familiar with.
In my case, I used Autohotkey.