Question
How do I plot a drawing to a postscript file using jlink?
Wildfire 5.0 M170
I am looking for some example jlink code that will print/plot a drawing to a postscript file.
The following 2 links show examples for creating a pdf export:but I can't seem to find anything for creating a postscript file.
ModelDescriptor descr = pfcModel.ModelDescriptor_Create(ModelType.MDL_DRAWING, partNumber, null);
Model dwg = session.RetrieveModel(descr);
Window window = session.CreateModelWindow(dwg);
dwg.Display();//This part works because the drawing is opened and displayed
PrinterInstructions pi = pfcExport.PrinterInstructions_Create();
PrintPrinterOption po = pfcExport.PrintPrinterOption_Create();
po.SetFileName(partNumber);
po.SetPrinterType("postscript");
po.SetPenTable("stdps.pnt");
po.SetSaveToFile(true);
po.SetSendToPrinter(false);
pi.SetPrinterOption(po);
dwg.Export(partNumber, pi);//ProEngineer crashes when executing this statement
The "abc" drawing is opened and displayed however the Pro/Engineer session crashes when executing dwg.Export(). If I comment that out the session does not crash.
I have no idea if what I am trying is even close to what is correct. Does anybody have any hints to get me started?
Thanks
--
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
I am looking for some example jlink code that will print/plot a drawing to a postscript file.
The following 2 links show examples for creating a pdf export:but I can't seem to find anything for creating a postscript file.
ModelDescriptor descr = pfcModel.ModelDescriptor_Create(ModelType.MDL_DRAWING, partNumber, null);
Model dwg = session.RetrieveModel(descr);
Window window = session.CreateModelWindow(dwg);
dwg.Display();//This part works because the drawing is opened and displayed
PrinterInstructions pi = pfcExport.PrinterInstructions_Create();
PrintPrinterOption po = pfcExport.PrintPrinterOption_Create();
po.SetFileName(partNumber);
po.SetPrinterType("postscript");
po.SetPenTable("stdps.pnt");
po.SetSaveToFile(true);
po.SetSendToPrinter(false);
pi.SetPrinterOption(po);
dwg.Export(partNumber, pi);//ProEngineer crashes when executing this statement
The "abc" drawing is opened and displayed however the Pro/Engineer session crashes when executing dwg.Export(). If I comment that out the session does not crash.
I have no idea if what I am trying is even close to what is correct. Does anybody have any hints to get me started?
Thanks
--
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

