Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Remove old suffix when cloning an assembly 3

Status
Not open for further replies.

MFDO

Mechanical
Aug 10, 2005
217
When cloning an assembly, how could I get rid of the old suffix in the file name?
i.e.: abcd_rev01 -> abcd


Michael Fernando (CSWE)
Tool and Die Designer
Siemens NX V8.5 + PDW
SWX 2013 SP3.0 X64
PDMWorks 2013
Logopress3
FastForm Advance
FormatWorks
 
Replies continue below

Recommended for you

Good question, I am looking forward to see the responses.
But don't forget to specify what version of NX you are on.
 
Just upgraded to Version 9.0 and my signature too.

Michael Fernando (CSWE)
Tool and Die Designer
Siemens NX V9.0 + PDW
SWX 2013 SP3.0 X64
PDMWorks 2013
Logopress3
FastForm Advance
FormatWorks
 
Michael,

Under naming tab

set your default output directory

hit Define naming rule button

check Replace

base string abcd_rev01

with

add/replace/rename string abcd



Brian Marchand-Die Designer
NX 9.0.2.5 / PDW
Dell Precision T7610 w/Xeon ES-2609
16G Ram - Nvidia Quadro K5000
Win 7 Pro x64
 
Brian, as we checked together it was not possible to replace the suffix totally.

In the example “abcd” contains letters and numbers and I don’t want “ _rev01” at all in the new project.


Michael Fernando (CSWE)
Tool and Die Designer
Siemens NX V9.0 + PDW
SWX 2013 SP3.0 X64
PDMWorks 2013
Logopress3
FastForm Advance
FormatWorks
 
Removing part of the existing file name is a bit beyond what the cloning tool can do, but you can accomplish it with only a little more work on your part.
[ol][li]Start the clone operation, specify a log file for output, and turn on the 'dry run' option.[/li]
[li]Add your files as necessary.[/li]
[li]Define a naming rule (replace), enter "_rev" as the base string and "__" as the replace string. This will turn "abcd_rev01" into "abcd__01"; you don't have to use a double underscore as the replace string, but use something that will yield a unique string to find later.[/li]
[li]Execute the clone operation (double check that you are in dry run mode first).[/li]
[li]Open the clone log file in a text editor that supports regular expression search and replace. I prefer notepad++, but there are others.[/li]
[li]Change the line: "&LOG Default_Naming_Technique: [highlight #FCE94F]NAMING_RULE[/highlight]" to "&LOG Default_Naming_Technique: [highlight #FCE94F]USER_NAME[/highlight]" and delete the following line (the one that lists the naming rule originally used).[/li]
[li]Use search and replace, use "__\d{1,2}" for the search string and nothing for the replacement.[/li]
[li]Save the file, start another clone operation. On the "log files" tab, choose "load and apply existing log file", choose your edited log file and run the clone operation.[/li][/ol]


www.nxjournaling.com
 
Whats the meaning of the \d{1,2} part of the search string?



Brian Marchand-Die Designer
NX 9.0.2.5 / PDW
Dell Precision T7610 w/Xeon ES-2609
16G Ram - Nvidia Quadro K5000
Win 7 Pro x64
 
Thanks Cowski, I didn't try it; but sounds like it will work.

Most of yesterday I wasted by manually changing the files with "save as" and now have other work to catch-up with. Next time I will try it.

I feel that the NX developers have not thought of this situation. They have allowed to add/modify suffixes but not the delete.

Michael Fernando (CSWE)
Tool and Die Designer
Siemens NX V9.0 + PDW
SWX 2013 SP3.0 X64
PDMWorks 2013
Logopress3
FastForm Advance
FormatWorks
 
Brian,
The "\d" is regular expression shorthand for "any digit [0-9]". The {1,2} specifies the quantity of the previous search item; in this case it will look for at least 1 digit and at most 2 digits. There are other ways we could have used to get the same result; the more you know about your data, the better you will be able to craft an expression to find exactly what you want.

A good reference site for regular expressions is:

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor