We have a series of attributes that are added in Teamcenter, which essentially create a smart part number for our parts, type of car, year, section of car, and then unique number. I'd like to be able to create an expression in our model seed file, that assemble's these attributes into a single string. Then we can use this single expression, in notes, in model text for engraving, etc.
I did some experimenting, but so far have not had luck as a "string" type expression, or I messed up the format...can this be done?
Solved! Go to Solution.
If some of the information is numeric, you will need to use the "format" function to convert it to a string; then in your string expression you can use the "+" operator to concatenate the strings.
If you can post some example (fictitious) input, I'm sure we can help work out the details.
If any of the attribute values are subject to change after creation, I wouldn't use the "ug_askPartAttrValue" function as it will not automatically update.
You can also create a new attribute and use the "Reference Text" command on the dialog to build a new string of existing attribute values. No need to use the concat sign. You could then just refer to the new attribute wherever you need to use its value:
All sounds good, but I haven't had much time to experiment yet... so in the mean time, here is some example data, and more info:
Existing attributes that should exist in the part. Note they don't always have values, if the user doesn't select them in Teamcenter, and I want to set a check for that, but that is another issue.
Part Attribute = Value
Car Type = C
Year = 17
cgr4_SectionComplex_toNX = 65
Internal Part Number = 123
The final result would need to be displayed as C17-65-123
If a "save as" were performed on the part, the user would have to update this info in Teamcenter, and then we would want the attributes to update in NX too.
@BenBroad That seems to be working, I've even changed some of the values in Teamcenter, and you can force it to update if the part is already open in NX, or it updates the next time you open in.