Tuesday, January 8, 2008

Renaming components outside of NX

If for some reason I needed to rename one of my components in an assembly; here's how I did it so far :

  • Rename the part in windows
  • Open the parent of this component
  • Click OK for the warning saying that the component couldn't be found/loaded
  • Open As.. or Substitute the component with the new one.

Instead, there's a command line utility under UGII directory called ug_edit_part_names.exe, which changes the reference of the renamed part in the parent. The good thing is that you don't need to actually load the parts to save the changes.

Suppose the assembly structure is like this :

assy
..|---part1
..|---part2
..|---part3
.......|---part3a
.......|---part3b ---> part3_renamed


If you need to rename part3b into part3_renamed ; here's the syntax :

ug_edit_part_names part3.prt -o part3.prt -change_name part3b.prt part3_renamed.prt

I must note that this tool does not rename the file itself, it merely updates the referencing parent. So you need to rename the file yourself at the O/S level.

There are some more uses;

ug_edit_part_names assy.prt -o assy.prt -upper_name will make all the components uppercase. Try ug_edit_part_names -examples for a few more usage examples including querying / changing the last known whereabouts of a component.

This could be used along with ugpc to rename components in a batch process, in case the clone assembly's renaming features are not fit for your needs.

2 comments:

Frank Malone said...

Very interesting.

Thanks once more.

Frank.

Anonymous said...

I was trying to develop a program that will rename a NX file from Windows. In my quest I found this 15 years old post which was a gem for me. The program I build actually automates whatever mentioned in this post. Now you can rename a file in a more easier fashion. Thanks Hakan for this excellent post. Check this Siemens NX File Renaming Github Page to download and install the program.

You can also check this Renaming NX files from Windows video tutorial to see how the program works.