Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Is it possible to create a looping Mapkey?
I want to run a mapkey in each item in the model tree until I tell it to quit.
Thanks
Not solely with Creo mapkeys, but you could have a mapkey that imported another mapkey which was generated from some external scripting. The imported mapkey could import another mapkey and so one and so forth until some input to your external script made it stop including an import in the newly generated mapkey.
For Fun Task
Create a Folder, change to that folder, and do some edit's. Get the 2 components testa.prt and testc.prt and your config files.
I thing recursive loading a mapkey is not possible, but two new ribbon buttons execute a mapkey will do this for me.
The button 'a' will call select button 'c' at the end, and vice versa.
Toolbar must be replaced by your own name, this was my test only
qaToolbar_QAT281052696 = qaToolbar_YourName and check the name
The mapkey sta will select the button 1 and run the mapkey ta
The mapkey stc will select the button 2 and run the mapkey tc
The mapkey alc will import the config testa.pro
The mapkey clc will import the config testc.pro
The mapkey alf will open the file testa.prt
The mapkey clf will open the file testc.prt
The mapkey ta will call Quit Window;Load Model A;Load Config A;Pick the Button C
The mapkey tc will call Quit Window;Load Model C;Load Config C;Pick the Button A
Important
During the loop you can write/update your tesa.pro or testc.pro from another program. Than you can load and do whatever you want. It will run until a stack overflow. This is your loop. You can control this by doing an action where you see it is starting or ending, I would do a model info at the beginning, then you know it's running if you see the file.
The mapkey qw will quit/close the window
Note: If you don't modify aour action you have to kill Creo
File testa.pro mapkey qw ~ Command `ProCmdWinCloseGroup`; mapkey alf ~ Select `main_dlg_cur` `appl_casc`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelOpen` ;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;~ Input `file_open` `Inputname` ``;\ mapkey(continued) ~ Update `file_open` `Inputname` `testa.prt`;\ mapkey(continued) ~ Activate `file_open` `Inputname`; mapkey alc ~ Select `main_dlg_cur` `appl_casc`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdRibbonOptionsDlg` ;\ mapkey(continued) ~ Select `ribbon_options_dialog` `PageSwitcherPageList` 1 `ConfigLayout`;\ mapkey(continued) ~ Select `ribbon_options_dialog` `ConfigLayout.ImportExportBtn`;\ mapkey(continued) ~ Close `ribbon_options_dialog` `ConfigLayout.ImportExportBtn`;\ mapkey(continued) ~ Activate `ribbon_options_dialog` `ConfigLayout.Open`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `testa.pro`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `testa.pro`;\ mapkey(continued) ~ Activate `ribbon_options_dialog` `OkPshBtn`;\ mapkey(continued) ~ FocusIn `UITools Msg Dialog Future` `no`;\ mapkey(continued) ~ Activate `UITools Msg Dialog Future` `no`; mapkey ta %qw;%alf;%alc;%stc mapkey sta ~ Activate `main_dlg_cur` `qaToolbar_QAT281052696:ta`; File testc.pro
mapkey qw ~ Command `ProCmdWinCloseGroup`; mapkey clf ~ Select `main_dlg_cur` `appl_casc`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelOpen` ;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;~ Input `file_open` `Inputname` ``;\ mapkey(continued) ~ Update `file_open` `Inputname` `testc.prt`;\ mapkey(continued) ~ Activate `file_open` `Inputname`; mapkey clc ~ Select `main_dlg_cur` `appl_casc`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdRibbonOptionsDlg` ;\ mapkey(continued) ~ Select `ribbon_options_dialog` `PageSwitcherPageList` 1 `ConfigLayout`;\ mapkey(continued) ~ Select `ribbon_options_dialog` `ConfigLayout.ImportExportBtn`;\ mapkey(continued) ~ Close `ribbon_options_dialog` `ConfigLayout.ImportExportBtn`;\ mapkey(continued) ~ Activate `ribbon_options_dialog` `ConfigLayout.Open`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `testc.pro`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `testc.pro`;\ mapkey(continued) ~ Activate `ribbon_options_dialog` `OkPshBtn`;\ mapkey(continued) ~ FocusIn `UITools Msg Dialog Future` `no`;\ mapkey(continued) ~ Activate `UITools Msg Dialog Future` `no`; mapkey tc %qw;%clf;%clc;%sta mapkey stc ~ Activate `main_dlg_cur` `qaToolbar_QAT281052696:tc`;
Have Fun!!!
You can do this kind of mapkey loops in a blink of a second in Tcl
Hi Folks, I have created the web application:
Repeatable Mapkey Generator | How to loop Creo Mapkey - try to check the video tutorials first: