Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Filename Extraction

2_BIG

Automotive
Mar 19, 2025
2
I am currently extracting a portion of the filename and use it in the text function. The purpose of this is in the filename there is an ID that will be engraved on the detail. On some jobs we will clone the assembly and change this ID. Currently we have to go in and manually change this ID so I used first(splitstring(last(splitstring(ug_askcurrentworkpart();"-"));"_")) to extract the protion of the filename I want. It works great until you change the filename. When the filename changes it doesn't update the Text. I have done some digging and all I can find is to use the Tools > Update > Update for External Change. This works but I would like to eliminate this step. Everything I have found so far is from older versions of NX (I am on NX12) and it sounds like they made some changes in NX 8 with respect to an Expression referencing an Attribute, you no longer have to depend on using KF routines but rather the user now has a direct Attribute function in the Expression tool which will update like any other Expression edit. Problem is I am new to all of this and I don't know how to utilize this. Is there another formula I can use to extract a part of a filename and have it update automatically? Any help would be appreciated.
 
Replies continue below

Recommended for you

To the best of my knowledge, the ug_askcurrentworkpart function still requires the "update for external change" to force the update.
 

Part and Inventory Search

Sponsor