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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

weblink retrieve model sub folder problem

CD_10811723
3-Newcomer

weblink retrieve model sub folder problem

I have specified a local folder as the working directory in Creo.

then want to use Weblink to retrieve models. However, I found that currently it can only retrieve models in the current directory and does not support models in subfolders.

 

Is there a better way to handle this?

 

code like this

let session = pfcGetProESession();
let currenDirectory = session.GetCurrentDirectory();
let device = currenDirectory.split(":")[0];

let path = currenDirectory.split(":")[1];

let modelDescr = pfcCreate('pfcModelDescriptor').CreateFromFileName(fileName)
modelDescr.Device = device;
modelDescr.Path = path;
let model = session.GetModelFromDescr(modelDescr)
if (!model) {
let retrieveOptions = pfcCreate('pfcRetrieveModelOptions').Create();
model = session.RetrieveModelWithOpts(modelDescr, retrieveOptions);
}
2 REPLIES 2

Hi CD_10811723,
 

Thank you for your question. 
I’d like to recommend to bring more details and context to your initial inquiry

It also helps to have screenshot(s) to better understand what you are trying to do in your process. 

This will increase your chances to receive meaningful help from other Community members. 

Regards,

Community Moderation Team.

Trebla
15-Moonstone
(To:CD_10811723)

Hi CD,

 

If you want to retrieve a model from a folder that is not the working directory, you can define the path as a string, for example C:\Temp\ like this:

 

modelDescr.Path = "C:\\Temp\\";

 with double \

Announcements


Top Tags