Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
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);
}
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.
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 \