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

ProPrintExecute

berry
1-Newbie

ProPrintExecute

Hello,
has anyone ever got ProPrintExecute() working?

I'm only getting PRO_TK_GENERAL_ERROR from it... The program is not going
to print or plot the drawings, actually it should only create plt files.
I'm working with Pro/Wildfire in asynchronous mode.

Any suggestion will be very appreciated...

Thanks a lot.
-Stefano

Here's a sample of my code. Note that mdl is actually a drawing.

ProError stampa(ProMdl mdl, char *plotter_name, char *file_plt) {
char *funcName = "stampa"
ProError err;
ProPrintPrinterOpts printer_opts;
ProPrintMdlOpts mdl_opts;
ProPrintPlacementOpts place_opts;
int w_id;

...

err = ProPrintPrinterOptionsGet(plotter_name, &printer_opts );
if ( PROE_STATUS(funcName, "ProPrintPrinterOptionsGet()", err) ) {
return err;
}
err = ProPrintMdlOptionsGet( mdl, &mdl_opts );
if ( PROE_STATUS(funcName, "ProPrintMdlOptionsGet()", err) ) {
return err;
}
err = ProPrintPlacementOptionsGet( &place_opts );
if ( PROE_STATUS(funcName, "ProPrintPlacementOptionsGet()", err) ) {
return err;
}

mdl_opts.sheets = PRINT_SELECTED_SHEETS;
mdl_opts.mdl = mdl;

err = ProWindowCurrentGet( &w_id );
if ( PROE_STATUS(funcName, "ProWindowCurrentGet()", err) ) {
return err;
}

printer_opts.paper_size.size = sheet_info.type;
mdl_opts.range[0] = 1;
mdl_opts.range[1] = 1;
place_opts.scale = 1;

ProStringToWstring( printer_opts.filename, file_plt );
err = ProPrintExecute( w_id, &printer_opts, &mdl_opts, &place_opts );
--> PRO_TK_GENERAL_ERROR

...


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.
2 REPLIES 2

Stefano-



I would try these things-



a)Test the application in synchronous mode and verify it is reproducible

b)Verify SPR 1094936 is not the cause of the issue.

c)Trying the same steps as in the application via the user interface and
making sure it works.



Good luck

-Kiran










I have got it working: below is the code that we use.

/* All Necessary Non Pro/TOOLKIT include files here */
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

/* All Necessary Pro/TOOLKIT include files here */
#include "ProToolkit.h"
#include "ProArray.h"
#include "ProDisplist.h"
#include "ProDrawing.h"
#include "ProMdl.h"
#include "ProUICheckbutton.h"
#include "ProUIDialog.h"
#include "ProUIOptionmenu.h"
#include "ProUIPushbutton.h"
#include "ProUITextarea.h"
#include "ProUtil.h"
#include "ProWindows.h"
#include "ProPrint.h"

int main ()
{

int err;
int windowID;
ProPath name_pcf_file;
ProDrawingSheetInfo sheetInfo;
ProMdl mdl;
int windowID;

ProPrintPrinterOpts print_options;


ProPrintPlacementOpts place_options;

ProPrintSize PrintSize =
{
A_SIZE_PLOT, /* size - A_SIZE_PLOT, VARIABLE_SIZE_PLOT, etc */
0, /* width - In inches, if size == VARIABLE_SIZE_PLOT */
0 /* height - In inches, if size == VARIABLE_SIZE_PLOT */
}; // ProPrintSize;



ProPrintMdlOpts mdl_options;

/***** Set The Drawing Plot Size *****/
err = ProDrawingSheetInfoGet(obj->proeMdl, 1, &sheetInfo);

/***** Create The IMS ps Plot File *****/
ProStringToWstring(name_pcf_file, FilePath and Name (UNC if needed));

/***** Populate the print *****/
ProPrintPCFOptionsGet(name_pcf_file, mdl, &print_options, &mdl_options, &place_options);

ProMdlWindowGet(mdl, &windowID);

ProStringToWstring(print_options.filename, IMSplotfile);
mdl_options.sheets = PRINT_ALL_SHEETS;
mdl_options.use_drawing_size = PRO_B_TRUE;

ProPrintExecute(windowID, &print_options, &mdl_options, &place_options);

)

It is part of a much larger program but this should be the basic code needed to make it work.
Announcements
Attention: Creo 7.0 Customers
Please consider upgrading
End of Life announcement here.