Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

Stefan,

Edit made and problem resolved,

 

The first group index letter may be determined on another file all together. Example: File 1 would start off at Group A and may also have Groups B & C.If so, Then File 2 which is another setup will start off with the next letter in this case, Group D. It may only have Group D and no others. So then the 3rd file would start off with Group E. and so on.

 

Also, I think the error of using the same letter again might stem from the system thinking the Journal is trying to create another Group with the same name which can't be done. So maybe checking for an existing name match is the answer? How that's done, I don't know. Just a thought. 

 

Thanks,

JimC

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

I have found that the selection is not reliable and one might get the last selected object first, so I changed to cycle through all the groups and operations available.

 

The renaming is done in two steps:

  1. add a suffix to avoid name collisions
  2. rename the groups and operations as advertised

Attached find the journal.

 

I am not checking if the letter index exceeds Z Smiley Frustrated

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.2, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

Stefan,

I think that might work. I'm going to test it a little more and have some others here test as well in real world use, to be sure everyone is happy. Is that possible? I'll let you know how it goes.

 

I did re-add the few adjustments to the latest version that I made in the original and have attached it for your records.

 

The changes are in line 117. (line 118 is altered) I removed the underscore between the D & 001. Also, since Underscores where being added on each side of the index letter, I changed the 12 to 11 & 4 to 3 to truncate the extra underscores read from the filename. Yes, I could have removed the added underscores as well. Either way the final Group name format needs to be 12345_D001_A_OP1 I was getting 12345_D_001__A__OP1. The format for us is critical because we have the post processor build a file structure for program storage using the different parts of the name as folder names and also for the program names.

 

I'll let you know how testing goes, soon.

 

Thank You Again,

JimC

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

I added your changes to my blueprint Smiley Wink

 

Hope you succeed with your testing.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.2, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

Pioneer
Pioneer

Hello Stefan,

Your journal works for my problem as well, Except i dont want to rename the parent group & Root group.

I want to rename the operation below that group just adding suffix "_1" as well..

 

Any suggestion ?

 

Thanks in advance

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Just use the IsGroup method to determine if the object is a NCGroup and skip renaming for it ?!?

 

Remove the following lines from the source code to skip renaming of groups.

        If Not RenameToOld Then
            If IsFirstGroup Then
                theIndex = NXOpenUI.NXInputBox.GetInputString("Enter Index of first group")
                IsFirstGroup = False
            Else
                theIndex = Chr(Asc(theIndex) + 1).ToString()
            End If
        End If
        
        If RenameToOld Then
            theGroupName = theNcGroup.Name & "_OLD"
        Else
            theGroupName = Left(thePartName, 12).Replace("-", "_") & "_" & theIndex & "_" & Right(thePartName, 4)
        End If
        
        If Not theGroupName = theNcGroup.Name Then
            If Not RenameToOld Then
                theSession.ListingWindow.WriteLine("  Renaming group ... " & theNcGroup.Name & " to " & theGroupName)
            End If
            
            theNcGroup.SetName(theGroupName)
        End If
Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.2, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

Pioneer
Pioneer

Hey, Thank  you very much...

 

It did't worked the way i wanted but lil tweaking to suit my requirment solved the problem...

 

Vij 

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

Stefan,

I owe you a 'post test' follow up. Everyone loves it. It's working great for us. Thanks again for all your help.

 

Jim

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

PLM World Member Legend PLM World Member Legend
PLM World Member Legend

As the original author of ...UGOPEN\SampleNXOpenApplications\.NET\CAM\RenameOperationsOntSelection.vb

I have updated this through the years/versions. It has become a bit more fancy with a windows form instead of 2 inputboxes.

It also supports program groups and operations or individual operations, and the user can choose to rename based on replacing a string, or rename by specifying a base name and a seq.no.

(Rename .txt to .vb)

 

Patrick Delisse
KMWE - Aero Engine
NX 12.0, TC 11.2, CAMPOST V22, Vericut 8.2, TDM 4.8
C#, VB, .NET

Re: Needed: VB.net Journal to rename Program Groups and operations in NX CAM

Patrick,

The updates look great. Thanks so much for sharing!

Mark Rief
Retired Siemens