Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

UG Versioning

Status
Not open for further replies.

bilmcl

Aerospace
Joined
Feb 1, 2008
Messages
3
Location
US
Hi,

I use the following versioning rules in my ug_english.def file, so my assemblies will load the latest version of part from defined search paths.

My question is what is meant by this command line? - Assemblies_VersionSubstitution:\\3a\\5
To what section of the PartNameFormat does the 3a and 5 refer?

My part numbers look like
fc_100200_1.prt < fc_100200.prt < fc_100200_a.prt

This old thread, thread561-122752, touched on versioning, but did not answer my question. I have looked in UG Help, but it does not explain how parenthesis groups and sections relate.

Thanks in advance for your help.
Bil McLaughlin
Design Engineer
Rolls-Royce Corp.

! ******************************************
! ** PART NAME VERSIONS **
! ******************************************
!
! The following rules are used to describe the part names the system will use
! when searching for the version of a part for an assembly. The syntax for the
! rules follows the Regular Expressions used by the UNIX system. Leaving the
! rules blank means the system does not recognize versions of files and will
! compare complete part names when searching for parts.
! Examples follow.
!
!
! This pattern specifies the general format of versioned part names.
!
Assemblies_PartNameFormat:(([a-z]+_)[0-9]+)((_([0-9]+))|(_([a-z]+))|)
!
! This value decides which portion of the Assemblies_PartNameFormat rule is the
! version independent portion of the name. It consists of 2 back-slashes "\\"
! followed by the number of the section.
!
Assemblies_PartNameSubstitution:\\1
!
! This value is used to match all versions of a part in a directory.
! It consists of the Assemblies_PartNameSubstitution rule specifying the
! version independent portion of the name along with the section of the
! Assemblies_PartNameFormat rule specifying the pattern for the part version.
!
Assemblies_PartNameMatch:\\1((_([0-9]+))|(_([a-z]+))|)
!
! This value decides which portion of the Assemblies_PartNameMatch rule
! is the version portion of the name.
!
Assemblies_VersionSubstitution:\\3a\\5
!
! This value decides the sorting order that will be used to determine the latest
! version of a file if several exist.
! Note: A valid option must be specified even if file versioning is not being used.
!
Assemblies_VersionType: ALPHANUMERIC
 
I haven't checked this for certain, but try without the \\ double backslashes.

Best Regards

Hudson
 
Hudson,

The way I understand it the \\ designate which set of parenthesis to look at for version substitution (\\3\\5a). I just don't know how to correctly label the parenthesis sets in the part format -
?? ??? ??
1 2 34 5 6 7
(([a-z]+_)[0-9]+)((_([0-9]+))|(_([a-z]+))|)

And, what does \\5a refer to?

This may not be, so much a UG question as a syntax question.

Bil McLaughlin
 
Regular expressions, each group is (). From left to right \1 is the first group \2 is the second, and so on.

I would define what is the name rule in the first line define, then in the second line use \1 then add what the revision rules are. I can give an example if needed.

-Dave Tolsma
 
Dave,
An example would be most helpful.
Bil McLaughlin
 
([a-zA-Z]?[a-zA-Z]?[0-9]{5,8}(|[-dwg]))(|(_){1}([a-zA-Z]{1}))

\1

\1(|(_){1}([a-zA-Z]{1}))

\2


- The first line defines the entire valid naming convention. There are two main groups, one is the name, the other is the version.
- The second line \1 says to NX that this is the part name
- Third line uses block one (\1) then put the same text for the revision as defined in line one
- Fourth tells nx that block 2 (\2) is the revision rule

I use something called Regex Coach to figure out the rules. Do a Google Search for it and you'll find it. The only issue is NX doesn't support many of the common Regex shortcuts, so need to be aware of that. I also put my range in as lower a-z or Upper A-Z which doesn't matter in NX but do it for future proofing in case they replace the regex solver, like they did after NX2 sometime.

hope this helps

-Dave Tolsma
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top