Skip to main content
3-Newcomer
June 23, 2023
Solved

Re-Activate Ribbon menu function

  • June 23, 2023
  • 1 reply
  • 1233 views

Good morning everyone,

I'm using Creo 10 and from the "Tools" ribbon menu I start my c# application.

We can do everything but in the "Model" menu a lot of function are disabled especially "Parameters". I don't understand why this happen when we start our application and from that application we are able to delete all the custom "Parameters".

 

When we close our app I thought the menu will be active again but this doesn't happen and if I do a right click in the assembly I have the icon for "Activate" it.

 

I tried these option:

https://www.ptc.com/en/support/article/CS288287?_gl=1*1b9p919*_ga*MTIyMzg5NjExOS4xNjg2MTI0MTUx*_ga_1QBT6P6HR1*MTY4NzUwNDM2My4xMS4xLjE2ODc1MDU1NzguMC4wLjA.

 

https://community.ptc.com/t5/Customization/Get-the-model-handle-for-the-activate-component-in-the-current/td-p/387940

 

ProAsmcompConstrRedefUI()  - https://community.ptc.com/t5/Customization/activate-sub-assembly-using-toolkit/m-p/570117/highlight/true#M7653

 

But nothing is working. I have to close the file and open it again to check the "Parameters".

 

ptc4809772_0-1687510950775.png

 

How can enable, with ProToolkit API, the menu during Close function of my application?

Thanks a lot,

Nicola

 

 

 

 

Best answer by RPN

It is hard to tell, my guess would be, that you closed a window, which was activated by your code. In that case you must activate the current window by using CTRL-A. You can save the current window ID, and restore it on app exit,

1 reply

RPN
RPN18-OpalAnswer
18-Opal
June 24, 2023

It is hard to tell, my guess would be, that you closed a window, which was activated by your code. In that case you must activate the current window by using CTRL-A. You can save the current window ID, and restore it on app exit,

3-Newcomer
June 27, 2023

I already tried with restore window ID () and was not working.

Today I try again only with this API function:

 

ProError status;
int window_id;

status = ProMdlWindowGet(curModel, &window_id);
status = ProWindowActivate(window_id);

 

This it's working good. Re-enable the ribbon menu and I can check the "Parameters".