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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Creating a plot using ProPrintExecute

benz2
1-Newbie

Creating a plot using ProPrintExecute

I'm stuck. I've run out of ideas, but I must be doing something lame here. My call to ProPrintPCFOptionsGet is returning an empty structure, and that in turn is making ProPrintExecute error out.

//BEGIN CODE
ProMdl model = new ProMdl();
ProMdlCurrentGet(&model);

ProError ret_val = PRO_TK_NO_ERROR;
int win_id;

//initialize options
ProPrintPrinterOpts print_opts;
ProPrintMdlOpts mdl_opts;
ProPrintPlacementOpts placement_opts;

ProPath path = L"C:\\ptc\\location\\printing\\config_file.pcf"; //location to pcf to be used

ret_val = ProWindowCurrentGet(&win_id);

if(ret_val == PRO_TK_NO_ERROR) ret_val = ProPrintPCFOptionsGet(path, model, &print_opts, &mdl_opts, &placement_opts);

if(ret_val == PRO_TK_NO_ERROR) ret_val = ProPrintExecute(win_id, &print_opts, &mdl_opts, &placement_opts);
//END CODE

Anyone see some obvious error in here?

Thx,

Ben Franklin


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.
1 REPLY 1
LarsZiegler
5-Regular Member
(To:benz2)

Hello Ben!

This is the code I'm using in my application.

ProError err;
ProPrintMdlOpts MdlOptions;
ProPrintPrinterOpts PrinterOptions;
ProPrintPlacementOpts PlaceOptions;
ProMdlType MdlType;
err = ProMdlTypeGet(m_Drw, &MdlType);
if (MdlType != PRO_MDL_DRAWING)
return PRO_TK_INVALID_ITEM;
err = ProMdlDisplay(m_Drw);
err = ProMdlWindowGet(m_Drw, &m_WinID);
err = ProWindowActivate(m_WinID);
err = ProWindowRefresh(m_WinID);
err = ProPrintPCFOptionsGet(L"tiff", m_Drw, &PrinterOptions, &MdlOptions, &PlaceOptions);
wcscpy_s(PrinterOptions.filename, PRO_PATH_SIZE, Name);
MdlOptions.use_drawing_size = PRO_B_TRUE;
PrinterOptions.save_to_file = PRO_B_TRUE;
PrinterOptions.send_to_printer = PRO_B_FALSE;
err = ProPrintExecute(m_WinID, &PrinterOptions, &MdlOptions, &PlaceOptions);
return err;

					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
Top Tags