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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Load drawing File from Working Directory in Jlink

ddhini
14-Alexandrite

Load drawing File from Working Directory in Jlink

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

1 ACCEPTED SOLUTION

Accepted Solutions
ddhini
14-Alexandrite
(To:ddhini)

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);

View solution in original post

4 REPLIES 4

Hi,

 

what Creo release+build do you use ?


Martin Hanák
ddhini
14-Alexandrite
(To:ddhini)

My above code Works fine without bugs .Thanks for tyour time

ddhini
14-Alexandrite
(To:ddhini)

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);

Top Tags