Part Name as Atrribute
Part Name as Atrribute
(OP)
Hi,
I am using native NX8.5 and want to know is there a way to call the name of a part file into an attribute in that same part? So if I have an attribute called "name" for instance and the part is called "123.prt" I want the attribute "name" to equal "123". The idea is that if I do a Save As on the part and call it something different the attribute "name" will automatically pickup the name of the new part file.
The reason I am wanting this is I have a range of attributes called out into a spreadsheet and currently I am manually editing this value to the name of the part. I thought there might be a way of calling this out automatically. I know there is a bunch of things I can do with parts lists and automatically calling out info but I really need this as an attribute in the part.
Thanks,
Jackie.
I am using native NX8.5 and want to know is there a way to call the name of a part file into an attribute in that same part? So if I have an attribute called "name" for instance and the part is called "123.prt" I want the attribute "name" to equal "123". The idea is that if I do a Save As on the part and call it something different the attribute "name" will automatically pickup the name of the new part file.
The reason I am wanting this is I have a range of attributes called out into a spreadsheet and currently I am manually editing this value to the name of the part. I thought there might be a way of calling this out automatically. I know there is a bunch of things I can do with parts lists and automatically calling out info but I really need this as an attribute in the part.
Thanks,
Jackie.





RE: Part Name as Atrribute
Another thread to consider is http://www.eng-tips.com/viewthread.cfm?qid=169701
The following equations for a string expression may solve the issue.
CODE --> Expression
A string part attribute can then be defined to reference the string expression.
HTH,
Joe
RE: Part Name as Atrribute
You will be forced to update to get the expression to change.
Anthony Galante

Senior Support Engineer
NX3 to NX9 with almost every MR (18versions) plus the NX10 Beta
RE: Part Name as Atrribute
ug_setPartAttrValue("NAME",subString(ug_askCurrentWorkPart(),1,8))
This returns an Attribute called "Name" with the first 8 characters of the part name.
As my file names are all 8 characters long this works well. After I do a Save As I have to run the Update for External Change on the assembly to have it update the Attribute but that saves me having to type it manually.
Thanks Joe for the telling me about this function. Interestingly if you do a search or even a "List All" in the Expression function menu this function is not listed.
Thanks for your help,
Jackie.