Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

part versioning rules

Status
Not open for further replies.

moog2

Mechanical
Jan 16, 2007
441
0
0
AU
I'd like to set up some versioning in our system, can anyone tell if these options will work with our numbering system.
I found these in an old thread.....

part_name_format :- (([0-9]+-)|([0-9]+))(-([A-HJ-NPRT-Y]{0,2})|)
part_name_match :- \1(-([A-HJ-NPRT-Y]{0,2})|)
part_name_substitution :- \1
version_substitution :- \2\3
version_type :- alphanumeric

our numbering goes in 2 blocks of 4, and parts without a rev letter are to be regarded as original revision.
EG.
CHMD-5501
CHMD-5502-A
CHMD-5501-B
CHMD-5501-C

FFXD-FT01
FFXD-FT01-A
FFXD-FT01-B
etc, etc

We also have descriptive names, but they won't be included in the versioning.

Any help greatly appreciated..
 
Replies continue below

Recommended for you

moog2 said:
...can anyone tell if these options will work with our numbering system.

They will not work with the examples that you gave.

A good start is to carefully read through the NX help file section: Home -> CAD -> assemblies -> part name versions.

A good online reference for regular expressions is:
Also, the site regex hero is a great online tool that allows you to test out regular expressions and gives you feedback on what is matched and what is not, allowing you to quickly refine your regular expression pattern.

www.nxjournaling.com
 
You gave me a few new favorites as well.

Probably my favorite part of regex hero is that it will generate some .net code (C# or VB) based on your supplied regex. That's a timesaver for me because I infrequently use regular expressions. Each time I do, I'm either googling for examples or searching through old code to refresh myself on how to use the results (matches, groups, etc).

www.nxjournaling.com
 
Thanks for the info, i had a quick look at the links, but can't spend too much time in one go.
This is what i figured should work, i tried just to capture the first 4 characters and the dash, after that it'll find anything up to the next dash which will be the rev, which should be ok.
hopefully someone can look at it to check, then i'll give it a test run when i can.

part_name_format :- ([A-Z]{2}[A-Z0-9]{2}-([A-Z0-9]+))(-([A-HJ-NPRSTV-Z])
part_name_match :- \1(-([A-HJ-NPRSTV-Z])
part_name_substitution :- \1
version_substitution :- \1
version_type :- alphanumeric

the file names follow this format

CHMD-5501 FFVT-P456 FFXD-FT01 CMVT-CFM3 FF62-0402 EXVT-KIT22

all revisions will be -A -B -C etc (with exceptions)

Once again any help appreciated....
 
@Cowski: I'm also an infrequent regex user, so these tools help a lot!
Although the approach of is a bit different it will also generate code snippets, but in a load of languages:
Perl, PHP, Python, Java, Javascript, ColdFusion, C, C++, Ruby, VB, VBScript, J#.net, C#.net, C++.net, VB.net

Graham Inchley, Systems Developer, Sandvik Coromant. HP EliteBook 8760w, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP4 64bit
Testing: NX9.0.2.5
 
moog2,
Your revised regular expression looks much closer to what you want. In the first post you state:
moog2 said:
parts without a rev letter are to be regarded as original revision.
Is this still the case? If so, your regular expression does not accommodate part names with no revision information.

The "version substitution" you have specified is incorrect (it can't be the same as the part name substitution).

Also, in the first post you state:
moog2 said:
We also have descriptive names, but they won't be included in the versioning.
Does this mean that some parts have names such as "WIDGET-FRONT.prt"? If so, these parts won't match your pattern (or at least they are unlikely to match the pattern). Parts that don't match the pattern won't be loaded and an error message will be displayed. This could get pretty annoying to users that are working with assemblies that use these components.

www.nxjournaling.com
 
Since you are using Part Versioning with the revision in the part name, I am guessing no TeamCenter to do this for you?

! ******************************************
! ** PART NAME VERSIONS **
! ******************************************
!
Assemblies_PartNameFormat: ([0-9]+\\.)([0-9][0-9]|([0-9][0-9sm]|([a-e]\\.[0-9][0-9sm])))
!
Assemblies_PartNameSubstitution: \\1
!
Assemblies_PartNameMatch: \\1([0-9][0-9]|([0-9][0-9sm]|([a-e]\\.[0-9][0-9sm])))
!
Assemblies_VersionSubstitution: \\1
!
Assemblies_VersionType: NUMERIC

Example part numbers we had: 57354856.prt, 54365489.01.prt, 56239854.0m.prt, 56239854.D.01.prt

Don't forget that you can run a check to see if your rules will work on your files.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Guys'
Damn, this is gonna be harder than i thought...

Yes, parts without a revision are regarded as "original".

Yes, we do have some descriptive names like "WIDGET-FRONT.prt", but they wouldn't need revisions, as they wouldn't be drafted anyway.
But they'd need to load up ok.

No, we don't have teamcentre.

I realised some of the links had code testing, but as a quick look, i couldn't figure it out, as i said I only get quick goes at stuff like this, time saving projects don't get allowed much time (stupid as it sounds). (its a "work faster not smarter mindset")

would adding something like this )|[A-Za-z0-9]+) also capture a descriptive text part name?

How would it go if it found a part called "FRNT-wheel-nut.prt" and "FRNT-wheel-bolt.prt" ?

is this getting any better?

part_name_format :- ([A-Z]{2}[A-Z0-9]{2}-([A-Z0-9]+))(-([A-HJ-NPRSTV-Z])|([A-Za-z0-9]+)
part_name_match :- \1(-([A-HJ-NPRSTV-Z])
part_name_substitution :- \1
version_substitution :- \2
version_type :- alphanumeric
 
moog2 said:
Yes, we do have some descriptive names like "WIDGET-FRONT.prt", but they wouldn't need revisions, as they wouldn't be drafted anyway.

The versioning rules that you are setting up are not limited to "drafting revisions"; it applies more generally to part revisions. If you are using the "load latest" option, NX will search the specified folders looking for all revisions of each component when you load an assembly; it will load the latest 'revision' that it finds. This can make maintaining assemblies easier by offloading the "searching for the new versions" work to NX. It could have some unintended consequences for drawings. If you want to use a specific version of a part in a given assembly (or master model drawing), you would have to open that particular part before opening the assembly.

www.nxjournaling.com
 
i wouldn't ever really need to load an old revision, i'm happy that i could leave those load latest options set for everything
 
moog2 said:
i wouldn't ever really need to load an old revision...

Do you use the master model method for your drawings? When you make a new revision to the model, do you also rev up the drawing? Do you keep old drawing/model revisions in the system for any length of time (for backup or in case you need to roll back a version)?

Let's say you have 12345.A and 12345.A_dwg, now you make a new revision 12345.B and 12345.B_dwg. If you need to open the rev A drawing for any reason, make sure to open the model before the drawing. Otherwise the rev A drawing will open the rev B model.

www.nxjournaling.com
 
One caution on search option for load latest.

The system will only search until it finds the first match for a later revision.

If you have an assembly with 123.b in its structure and 123.d is the latest released but in a working folder an engineer has 123.e, you could end up with not what you want.
IF the released folders are in the search option list in front of the engineer's working folder, you will load 123.d and the system will quit looking further.
IF you have the enginner's working folder first, you will get 123.e, while you may be expecting 123.d, the latest released.

The order of files in the search path list is critical. Also, if you use the /... for 'all subdirectories' searching, the system searches the sub-folders by creation order, not alphabetical name order. This was true as of NX4, unless it has been changed since then.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
We use master model drwgs, I'll only revise the actual part itself, not the drwg file name, therefore the drwg will need to use the load latest to find the correct one, when the drwg is updated. ie: 12345-A and 12345_dwg
We always archive the pdf's, thats enough info if you ever had to roll a part back one rev.

The file directories, are very simple and there is no chance that the system could find the wrong revision first.
I normally set load options to "as saved" cos its quicker,(i presume that would still work ok?)
if i can't find a part i'll use "from search folders" , but as i said, it can't get the wrong part.

Thanks
 
I've sort of managed to use the regex tester, but NX won't load any parts using this code due to something about the syntax?

(([A-Z]{2}[A-Z0-9]{2}-)([A-Z0-9]+-))|([A-Za-z0-9]+)|-([A-HJ-NPRSTV-Z])

I'm testing it using NX6 which is still loaded on this m/c. Where do i find the "verify directories" in the load options?
 
 http://files.engineering.com/getfile.aspx?folder=9ab52919-7a50-4db6-b700-d7d8979f83af&file=CODE-1.JPG
Status
Not open for further replies.
Back
Top