Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
How to load the Files from its working directory in Jlink .I need to load the files from its working directory .
Even though i set working directory ,I cannot load the files from directory by the following code.please help me to solve this problem.
String directory=curSession.GetCurrentDirectory().toString();
String modelLocation=""+directory+"\\"; String drw_name = drawfiles[i]; ModelDescriptor desc1 = pfcModel.ModelDescriptor_Create(ModelType.MDL_DRAWING, drw_name, null); desc1 = pfcModel.ModelDescriptor_CreateFromFileName(drw_name); desc1.SetPath (modelLocation); draw=(Drawing)curSession.RetrieveModelWithOpts(desc1, pfcSession.RetrieveModelOptions_Create()); draw.Display();
//Exporting to pdf
draw.Export(draw.GetFullName(), Mypdfexportinstructions);
Thanks regards,
Dinesh
Solved! Go to Solution.
Its Working fine.I close this question.
String directory=curSession.GetCurrentDirectory().toString(); String modelLocation=""+directory+"\\"; String drw_name = drawfiles[i]; ModelDescriptor desc1 = pfcModel.ModelDescriptor_Create(ModelType.MDL_DRAWING, drw_name, null); desc1 = pfcModel.ModelDescriptor_CreateFromFileName(drw_name); desc1.SetPath (modelLocation); draw=(Drawing)curSession.RetrieveModelWithOpts(desc1, pfcSession.RetrieveModelOptions_Create()); draw.Display(); //Exporting to pdf draw.Export(draw.GetFullName(), Mypdfexportinstructions);
Hi,
what Creo release+build do you use ?
My above code Works fine without bugs .Thanks for tyour time
Its Working fine.I close this question.
String directory=curSession.GetCurrentDirectory().toString(); String modelLocation=""+directory+"\\"; String drw_name = drawfiles[i]; ModelDescriptor desc1 = pfcModel.ModelDescriptor_Create(ModelType.MDL_DRAWING, drw_name, null); desc1 = pfcModel.ModelDescriptor_CreateFromFileName(drw_name); desc1.SetPath (modelLocation); draw=(Drawing)curSession.RetrieveModelWithOpts(desc1, pfcSession.RetrieveModelOptions_Create()); draw.Display(); //Exporting to pdf draw.Export(draw.GetFullName(), Mypdfexportinstructions);