cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming parts with jlink

Regular Member

Renaming parts with jlink

Hello

 

I am trying to rename some parts using jlink.

Has anyone already done that? Or any suggestion on how to do it?

 

Thank you

 

Regards

2 REPLIES 2

Re: Renaming parts with jlink

Hi, it's quite easy. It depends on your skill. If you are familiar with java then you need to learn how to develop and run jlink in creo. If you are not, you need first learn at least basics of java.

Considering first option the guide for jlink is located in <creo_load_point>/Common Files/jlink/jlinkug.pdf

I have post setup guide last year, but i can't find it know. There are all steps to achieve jlink running in creo.

Once you run jlink, you just need to get model object and call rename method on it. Eg:

 

Session session = pfcGlobal.GetProESession();

Model model = session.getCurrentModel();

model.rename("newawesomename");

 

If you have any questions, feel free to ask. Good luck.

Re: Renaming parts with jlink

Dear vjoer ,

I have tried the below method ,Its worked for me .

 

//Get the Session
Session session = pfcGlobal.GetProESession();
//Get the Active Model
Model mod=session.GetCurrentModel();
//Rename the Model in Session //Rename (String NewName, /*optional*/ Boolean RenameFilesToo)  from Jlink Doc mod.Rename(NewFileName,false);

Note from PTC

If the models are retrieved from a directory other than the current working directory the Models are renamed only in the session and not on disk

 

Thanks Regards,

Dhini