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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Drawing.Export throws Exception XtoolkitCommError

hamzawaseem
10-Marble

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
1 REPLY 1

Read the following articles:

  1. "Getting XToolkitCommError exception when running a macro from an asynchronous mode customization which takes a long time to update a large model": https://www.ptc.com/en/support/article/CS348237
  2. "Jlink XToolkitCommError occurs when Creo Java Object Toolkit operation is left hanging in Creo JOTK 1.0": https://www.ptc.com/en/support/article/CS198094
  3. "Accessing Property IpfcAsyncConnection.Session randomly throws exception pfcExceptions::XToolkitCommError in Creo Parametric 4.0 M050": https://www.ptc.com/en/support/article/CS291480
  4. "Jlink XToolkitCommError occurs when Creo Java Object Toolkit operation is left hanging in Creo JOTK 1.0": https://www.ptc.com/en/support/article/CS198094
  5. "Error: pfcExceptions::XToolkitGeneralError received while trying to start or connect to a Creo Parametric session through VB API application": https://www.ptc.com/en/support/article/CS46034
Announcements


Top Tags