Skip to main content
14-Alexandrite
March 14, 2025
Solved

Mapkey with scripts in the middle?

  • March 14, 2025
  • 2 replies
  • 2371 views

Currently on Creo 10, but I think the question applies to many versions.

 

I want to Creo to execute a script file near the beginning of the mapkey.  I can make it work at the end.  (The case below is just an example,)

 

I can make it work at the end.

mapkey w1 @MAPKEY_NAMEChange display to creo Colors;\
mapkey(continued) @MAPKEY_LABELChange to Creo Colors;~ Select `main_dlg_cur` `appl_casc`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdRibbonOptionsDlg` ;\
mapkey(continued) ~ Select `ribbon_options_dialog` `PageSwitcherPageList` 1 `colors_layouts`;\
mapkey(continued) ~ Open `ribbon_options_dialog` `colors_layouts.Color_scheme_optMenu`;\
mapkey(continued) ~ Close `ribbon_options_dialog` `colors_layouts.Color_scheme_optMenu`;\
mapkey(continued) ~ Select `ribbon_options_dialog` `colors_layouts.Color_scheme_optMenu` 1 `1`;\
mapkey(continued) ~ Activate `ribbon_options_dialog` `OkPshBtn`;\
mapkey(continued) @SYSTEMC:\\TEMP\\test.bat;

 

But I would like to do it at the begining

mapkey w1 @MAPKEY_NAMEChange display to creo Colors;\
mapkey(continued) @MAPKEY_LABELChange to Creo Colors;\

mapkey(continued) @SYSTEMC:\\TEMP\\test.bat;\

mapkey(continued) ~ Select `main_dlg_cur` `appl_casc`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdRibbonOptionsDlg` ;\
mapkey(continued) ~ Select `ribbon_options_dialog` `PageSwitcherPageList` 1 `colors_layouts`;\
mapkey(continued) ~ Open `ribbon_options_dialog` `colors_layouts.Color_scheme_optMenu`;\
mapkey(continued) ~ Close `ribbon_options_dialog` `colors_layouts.Color_scheme_optMenu`;\
mapkey(continued) ~ Select `ribbon_options_dialog` `colors_layouts.Color_scheme_optMenu` 1 `1`;\
mapkey(continued) ~ Activate `ribbon_options_dialog` `OkPshBtn`;

Best answer by Chris3

Below is a PTC/User presentation I gave on mapkeys with scripts.

2 replies

24-Ruby III
March 14, 2025

Hi,

my guess ... it is not possible to tell Creo to wait for the bat file to finish when executing the mapkey.

 

I think you can add PAUSE into mapkey after starting bat file -AND- add an information window to display at the end of the bat file.

These two "actions" will enable you to synchronize mapkey with bat file.

  • you launch mapkey
  • Creo will display PAUSE window
  • you will wait until you see information window
  • you will close information window
  • you will close PAUSE window

 

21-Topaz I
March 14, 2025

I do this all the time with .vbs scripts. Not sure if the functionality is different for .bat but the mapkey always waits for the .vbs to finish before continuing onto the next mapkey line.

Chris321-Topaz IAnswer
21-Topaz I
March 14, 2025

Below is a PTC/User presentation I gave on mapkeys with scripts.

N.Barnes14-AlexandriteAuthor
14-Alexandrite
March 14, 2025

This is amazing!     And also, it helped me find my problem. Which was that the file extension wasn't capitalized.    My basic goal is to track metrics for a few months on which mapkeys users are really being used.