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

Community login and other support tools will be unavailable Saturday May 3rd 9:00 am to 3:00 pm (EST) due to planned maintenance. Learn More

Translate the entire conversation x

Mapkey with scripts in the middle?

N.Barnes
14-Alexandrite

Mapkey with scripts in the middle?

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`;

ACCEPTED SOLUTION

Accepted Solutions
Chris3
21-Topaz I
(To:Chris3)

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

View solution in original post

5 REPLIES 5

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

 


Martin Hanák
Chris3
21-Topaz I
(To:N.Barnes)

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.

Chris3
21-Topaz I
(To:Chris3)

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

N.Barnes
14-Alexandrite
(To:Chris3)

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.    

 

 

Interesting -- couple of suggestions on how to also approach this.

 

Attached is a Nitro-CELL Workbook that does this same thing via a sequence of mapkeys - basically they are executed individually in the top-down order within the Excel Sheet.  I present this as an example of what you could do with other functions in your workflow.   Alternatively - some of these settings could be set dynamically by setting/changing configuration options.

 

You can download and play with this for FREE (no license required) - https://simplifiedlogic.com/nitro-cell  (Requires J-LINK, just point the application to the attached file to run after localized to your Creo Installation).

 

The same approach could be done using CREOSON  - http://www.creoson.com/functions.html  (interface : mapkey) within a more formal programming structure.

 

Hope this provides some additional approaches.

 

Dave

Announcements


NEW Creo+ Topics: PTC Control Center and Creo+ Portal

Top Tags