Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Windows in Pro/E

apilikov

New member
Hi All.


I have a big trouble which makes me very angry because I really don't know what to do. I have synchro PRO/TOOLKIT app and to close windows I use ProWindowCurrentSet() with the window ID and then ProWindowCurrentClose(). And here is the problem. When I'm calling this functions and I'm still on break in my app I can see that PRO/E doesn't update the window which I deleted. PRO/E does it only when my function returns and after clicking and activating the proe window. How to fix it? It really makes a big problem for my app.
smiley19.gif
smiley19.gif
smiley19.gif
 
williaps said:
Could you please post a code snippet so we can better understand exactly what your application is doing?


Yes of course.


Here is my function for opening and closing the Mdl Windows in proe.


ProError MdlVisibleSet(ProMdl pMdl,bool bVisible)


{


int nWindowId=0;


if(bVisible)


{
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">


ProName wPartName;


ProError eErr;


if((eErr=ProMdlNameGet(pMdl,wPartName))!=PRO_TK_NO_ERROR)


return eErr;


ProMdlType eType;


if((eErr=ProMdlTypeGet(pMdl,&eType))!=PRO_TK_NO_ERROR)


return eErr;


if((eErr=ProObjectwindowCreate(wPartName,(ProType)eType,&nWindowId))!=PRO_TK_NO_ERROR)


return eErr;


eErr=ProMdlDisplay(pMdl);


if((eErr=ProWindowActivate(nWindowId))!=PRO_TK_NO_ERROR)


return eErr;


return PRO_TK_NO_ERROR;</BLOCKQUOTE>


}


else


{
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">


if(!MdlVisibleGet(pMdl,nWindowId))


return PRO_TK_NO_ERROR;


ProWindowCurrentSet(nWindowId);


ProWindowCurrentClose();


return PRO_TK_NO_ERROR;</BLOCKQUOTE>


}


}





and then I'm trying to close the window with ProWindowCurrentClose() I can see that proe did not close it.
 
Apilikov,


If you want to close a window then it cannot be the current window. The following documentation states just that. You have to make a different window the current window before deleting the window that corresponds to nWindowId.





Closes a window and breaks the object-to-window attachment. The function deletes the window, if it is not the base window.


You cannot break the attachment for the currently active window. Use the function ProWindowCurrentSet() to make a different window be the active window before calling this function.


This function is equivalent to the Pro/ENGINEER option to quit the window.
 

Sponsor

Articles From 3DCAD World

Back
Top