×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Part Name as Atrribute

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.

RE: Part Name as Atrribute

Legs11,

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

ug_askCurrentWorkPart() 

A string part attribute can then be defined to reference the string expression.

HTH,
Joe

RE: Part Name as Atrribute

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources