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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Load drawing File from Working Directory in Jlink

ddhini
15-Moonstone

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

ACCEPTED SOLUTION

Accepted Solutions
ddhini
15-Moonstone
(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
MartinHanak
24-Ruby III
(To:ddhini)

Hi,

 

what Creo release+build do you use ?


Martin Hanák
ddhini
15-Moonstone
(To:ddhini)

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

ddhini
15-Moonstone
(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);

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags