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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

run mapkey... not valid

lgüthle
1-Newbie

run mapkey... not valid

Hey

if I try to execute the following macro (clicking the "Switch Dimensions"-Button in Tools ribbon):

ProMacroLoad(L"~ Command `ProCmdInfoSwitchDims` ;");

ProMacroExecute();

I get "PRO_TK_NOT_VALID" - The specified macro is not valid as error. But I don't understand why?

Am I violating any of those four restrictions??

Note that this function is not supported for the following situations and tasks

1.Activating windows or setting the current model

2.Erasing the current model

3.Completing dialog commands ending with an "OK" button press. It will cancel some dialogs after showing them.

4.Executing macros during a trail file replay.


Best regards


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.
ACCEPTED SOLUTION

Accepted Solutions

I think he had solved that issue by changing the work mode of the dialog.

So the dialog is now modeless and there is an extra button to run only that mapkey.

We have same problems with the macro: ~ Command `ProCmdInfoSwitchDims`;

It can't be used inline inside of a synchronous process. So you need to use it standalone, and that's possible with the modeless window and a button that runs the mapkey without do stuff after it.

Br,

Eike

View solution in original post

5 REPLIES 5

Luis,

is Tools tab active, when application executes a mapkey ?

MH


Martin Hanák

Yes it is (because i start the application from the Tools tab).

But just to make sure I already tested:

ProMacroLoad(L"~ Activate `main_dlg_cur` `page_Tools_control_btn` 1;~ Command `ProCmdInfoSwitchDims`;");

...and got the same error

//edit1: I forgot to mention that right before the Macro I do use a ProUIDialog....

... I am really confused now...

Following MyFunction is working:

int MyFunction(uiCmdCmdId command, uiCmdValue *pValue, void *pPushCommandData){

  status = ProMacroLoad(L"~ Activate `main_dlg_cur` `page_Tools_control_btn` 1;~ Command `ProCmdInfoSwitchDims`;");

  status = ProMacroExecute();

  return 0;
}


This version is not working ?????


int MyFunction(uiCmdCmdId command, uiCmdValue *pValue, void *pPushCommandData){

  status = ProMacroLoad(L"~ Activate `main_dlg_cur` `page_Tools_control_btn` 1;~ Command `ProCmdInfoSwitchDims`;");

  status = ProMacroExecute();

...do other stuff...

return 0;
}

//edit2: ok MacroExecute is still throwing an error but creo somewhat still executes the macro...

I think he had solved that issue by changing the work mode of the dialog.

So the dialog is now modeless and there is an extra button to run only that mapkey.

We have same problems with the macro: ~ Command `ProCmdInfoSwitchDims`;

It can't be used inline inside of a synchronous process. So you need to use it standalone, and that's possible with the modeless window and a button that runs the mapkey without do stuff after it.

Br,

Eike

FV
17-Peridot
17-Peridot
(To:lgüthle)

One could use ProDisplaymodeSet instead of macro...

Eike_Hauptmann
13-Aquamarine
(To:FV)

Uh ok ... I don't know that.

Thx Felix

Announcements


Top Tags