Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Modify Journal code to rename parts

[ Edited ]

Hello,

 

I found one journal which renames the component names in the assembly navigator. I tried the following scenario.

 

1) When assembly is exported as JT, all parts are getting suffix "_jt" in their name.

 

Jt.PNG

 When I run the journal it removes suffix _jt from all parts.

 

jt1.PNG

 

 2) Now when assembly is exported as parasolid. Components gets suffix as _id6_x_t, _id11_x_t etc.

jt2.PNG

 

What I understood is line in journal to rename parts is

 

Dim newShortName As String = oldShortName.Replace("_jt", "")

If I modify this as

 

Dim newShortName As String = oldShortName.Replace("_id6_x_t", "")

 

It will only rename one component. If I want to rename the all components by removing respective suffix _id6_x_t, _id11_x_t etc. Is this possible to modify code in such way? If yes. It would be nice to have code with modification. I dont know whether it is possible or not, I am not the person having coding knowledge. Smiley Happy

 

 

Testing NX10 | NX11| TC-NX Integration
Teamcenter 11.2 | TC Vis 11.3 | Active Workspace 3.2
4 REPLIES
Solution
Solution
Accepted by topic author Ganesh_Kadole
‎03-21-2017 07:24 AM

Re: Modify Journal code to rename parts

Using regular expression pattern matching is one way to find the "_idn_x_t" suffix in each part. However, if we remove the suffix, each part in your example assembly would end up with the same name. I see no safeguards in the journal code to avoid overwriting an existing file; so the code would save a part, then overwrite it when the next one gets saved. The result would be one component part in your directory, whichever happened to be saved last; the rest of the files would be lost.

Solution
Solution
Accepted by topic author Ganesh_Kadole
‎03-21-2017 07:24 AM

Re: Modify Journal code to rename parts

Exporting the assembly as parasolid we need to provide the name and all the components of parasolid gets the same name with suffix like _id1_x_t, _id2_x_t etc. So is it ok to conclude that there is no way retain the name of components in parasolid like it is possible when exporting the assembly using the STEP format.

Testing NX10 | NX11| TC-NX Integration
Teamcenter 11.2 | TC Vis 11.3 | Active Workspace 3.2
Solution
Solution
Accepted by topic author Ganesh_Kadole
‎03-21-2017 08:46 AM

Re: Modify Journal code to rename parts

Re: Modify Journal code to rename parts

Thank you @cowski1 Smiley Happy

Testing NX10 | NX11| TC-NX Integration
Teamcenter 11.2 | TC Vis 11.3 | Active Workspace 3.2