Skip to main content
13-Aquamarine
May 29, 2024
Question

disable Save Option

  • May 29, 2024
  • 3 replies
  • 2222 views

Hi Guys, Good Evening

 

i want to disable the "File->Save" the "Save" Option through toolkit. if any one knows please help 

 

 

regards

Aravind

3 replies

23-Emerald III
May 29, 2024

WHY????

What good is a system if you cannot save your work?

Aravind9813-AquamarineAuthor
13-Aquamarine
May 29, 2024

no, i just want to disable the save option once the model opens. i've no idea about to disable the "Save" Option.


ProError err;
ProMdl mdl;
int windowid;
string str = "";
ProName mdlname;
ProStringToWstring(mdlname, (char*)str.c_str());
err = ProMdlFiletypeLoad(mdlname, PRO_MDLFILE_PART, PRO_B_FALSE, &mdl);
err = ProMdlDisplay(mdl);
err = ProMdlWindowGet(mdl, &windowid);
err = ProWindowActivate(windowid);

18-Opal
May 29, 2024

This is notifier called on pressing the menu in Creo. Most of the pre notifier will skip the invoked action.


typedef ProError (*ProModelSavePreAction) (ProPath r_model_path);

/*
Purpose: This is the notification function called before saving a model.
<p>
Users must supply this function by calling <b>ProNotificationSet()</b>
with the notify type PRO_MODEL_SAVE_PRE.
If the model name is initialized by this function, the
saving utility will not interactively prompt for the model name
to be saved.
<p>
If this function returns an error, the saving action will be
aborted by Creo Parametric.

Input Arguments:
None

Output Arguments:
r_model_path - The user-supplied function should initialize this
variable to the path to the model to be saved. If it
is not initialized, the system prompts for the model
path interactively.

Return Values:
PRO_TK_NO_ERROR - Successful exit from this function.
Other - An error was encountered. Model saving will be stopped.

Aravind9813-AquamarineAuthor
13-Aquamarine
May 30, 2024

Aravind98_1-1717046834510.png

no, my requirement is, once the model opens this default save option should be disable, same like as "check in" Option.

 

18-Opal
May 30, 2024

That would mean to configure the interface (greyed out) by you, as far I know, you can’t. Save, is for the current model, so you can decide (based on the model handle)  to allow save, or abort, I don’t see a difference, just write something to the message area that you don’t allow to save the model  for whatever reason.

Your model could contain external data for that, just check this during this callback and decide. 

Community Moderator
June 6, 2024

Hello @Aravind98,

 

It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Community Moderation Team.