Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Part Name as Atrribute 2

Status
Not open for further replies.

Legs11

Mechanical
Apr 12, 2008
12
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.
 
Replies continue below

Recommended for you

Attached is a video to demonstrate what Joe is referring to.
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
 
This is the string I ended using in the expression:

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor