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

Drawing.Export throws Exception XtoolkitCommError

hamzawaseem
Regular Member

Drawing.Export throws Exception XtoolkitCommError

Hello Everyone,

Thanks for helping me before, I have another problem which may need your assistance.


I am trying to export drawing files to PDF using JAVA (Jlink) with CREO PARAMETRIC. The code works, but sometimes, specially while exporting drawings that have assemblies, the Export function throws a Exception

XToolkitCommError.

Code:

PDFExportInstructions Mypdfexportinstructions = pfcExport.PDFExportInstructions_Create();
PDFOptions Myoptions = PDFOptions.create();


PDFOption MyPdfOption_Color = pfcExport.PDFOption_Create();
MyPdfOption_Color.SetOptionType(PDFOptionType.PDFOPT_COLOR_DEPTH);
MyPdfOption_Color.SetOptionValue(pfcArgument.CreateIntArgValue(PDFColorDepth._PDF_CD_COLOR));
Myoptions.append(MyPdfOption_Color);

 

PDFOption MyPdfOption_Layer = pfcExport.PDFOption_Create();
MyPdfOption_Layer.SetOptionType(PDFOptionType.PDFOPT_LAYER_MODE);
MyPdfOption_Layer.SetOptionValue(pfcArgument.CreateIntArgValue(PDFLayerMode._PDF_LAYERS_NONE));
Myoptions.append(MyPdfOption_Layer);

PDFOption MyPdfOption_Launcher = pfcExport.PDFOption_Create();
MyPdfOption_Launcher.SetOptionType(PDFOptionType.PDFOPT_LAUNCH_VIEWER);
MyPdfOption_Launcher.SetOptionValue(pfcArgument.CreateBoolArgValue(false));
Myoptions.append(MyPdfOption_Launcher);

Mypdfexportinstructions.SetOptions(Myoptions);

 

proeDrawing.Export(filename, Mypdfexportinstructions);

 

---------------------------------------------------------------------------------------------------------------------------

For assembly, I call this function in a loop for each part in that assembly.

Please help, stuck here for days!

Thanks
Hamza

 

 

Hamza
Announcements