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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Renaming parts with jlink

vjoer
7-Bedrock

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
sjuraj
15-Moonstone
(To:vjoer)

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.

ddhini
15-Moonstone
(To:vjoer)

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

Announcements


Top Tags