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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Macro Operations in a New Window

SP_10210577
11-Garnet

Macro Operations in a New Window

Hello I'm trying to make the drawing model a new window of Creo now and use fast printing using macros.

It works well if you run in a different environment (for example, an existing window rather than a new one), but when you create and run a new window using the ProObjectWindowMdlnameCreate() function, the ProMacroExecute(); function returns a PRO_TK_NOT_VALID error

I don't see the window at all, but I think it's because I'm trying to run the macro properly, is there a way to fix it?

Sleep(); I tried a function to give delay, but there was a delay in the window as well as ProMacroExecute()

I'd appreciate it if you could tell me how. If there's any other cause than this, please help.

I am attaching the code I used below.

Thank you.

 

 

 

status = ProObjectwindowMdlnameCreate(name, (ProType)PRO_MDL_DRAWING, &window_id);
status = ProMdlDisplay(mdl);
status = ProWindowCurrentSet(window_id);
status = ProWindowActivate(window_id);
wchar_t* mkMCRTopLevel1 = L"~ Command `ProCmdQuickPrint`  1;";
	
status = ProMacroLoad(mkMCRTopLevel1);
if (status == PRO_TK_NO_ERROR)
{

	status = ProMacroExecute();
	if (status != PRO_TK_NO_ERROR)
	{
        //This is where PRO_TK_NOT_VALID occurs.
		return;
	}
}
else
{
	iMessageBox(L"ProMacroLoad error");
	return;
}

 

 

 

0 REPLIES 0
Top Tags