Okay, hopefully this will be my last update. New code for a unified mapkey is provided below. End user just has to run the one mapkey now, which will advance through up to 100 pages. (User is prompted to continue after each page, and to click cancel after it cycles back around to first page.)
Knowing that one mapkey can call another, I had expected a mapkey could call itself to create a loop. As @dnordin pointed out, and I learned for myself meanwhile, this doesn't work. If a mapkey has a statement to call itself, it's ignored. You can't even workaround by create different mapkeys; i.e. if mapkey1 calls mapkey2 which calls mapkey1, then whichever one is farther down in the config.pro file is ignored. I worked around this by just pasting in 100 calls to the subroutine (I don't think anyone here has ever created a drawing with more than 20 pages on it).
@STEVEG - Very clever approach! Working with batch files is more trouble than I want to spend on this though, as slick as the results might be...
Frustrating new issue I found over the course of testing:
I can't tell if this is a Creo Parametric issue, or something inherent to certain fonts? When changing to these fonts, some special characters get replaced. In particular, the problem is with the "non-breaking space" (U+00A0) character. I pasted the updated character into a unicode test webpage, and it was reported as being an "en quad" (U+2000) character. This ought to also look like a space, but it's showing up on screen in Creo as a rectangle. Still printing in my PDF's properly at least, even though it's garbled on screen, lol! And I can fix it on screen if I just manually paste new "non-breaking space" characters in place wherever they're used, but they aren't updating properly when I switch to fonts, at least to certain ones. Problem occurs with the default "font", "Arial WGL", and "Garamond". Does not occur with "Arial" or "Times New Roman". Weird...
There are two specific cases where I've used these characters to work around Creo limitations:
Oftentimes, we'll have more than one coordinate system in use on a project, and this indicated with a subscript. For instance, there may be XBUS and XPAYLOAD coordinates. I created "coordinate balloon" & "coordinate arrow" symbols that have variable text, including some "preset values" with commonly used suffixes that can be selected with a pop-up menu in the symbol placement GUI. Most often, user wants the suffix to be blank and just say X. Null value for text isn't allowed. A space character is allowed, but can't be set as the default value for that pop-up menu. Non-breaking space looks the same, and can be the default. Looks like I'll have to edit the master symbols, and users will have to update them separately.
Second use is peculiar to our sandwich panel drawings that have a "hole table". We use the out-of-the-box hole table feature, configured to provide coordinates of all the axes in a special assy, each of which has an ID code manually typed in as the feature name ("A-1", "A-2", etc). The drawings have a plan view next to the table, where the holes are all labeled for visual reference. I didn't want to have to manually create and locate all these annotations, or provide an opportunity for typos, so we adjusted things so the 3D axes system tags themselves would show up in the drawing view. Lead engineer complained that these tags were overlapping with the hole edges and weren't clearly legible. No easy way to tweak their position, so I decided to just throw some spaces in front of the name to indent the code (" A-1", " A-2", etc). You can't have regular spaces in feature names, but non-breaking spaces work. Looks like we'll have to re-paste the spaces in front of all these feature names... I'm baffled why changing the font in the drawing is affecting the character in the assy, but that does seem to be what's happening.
<sigh>
Here's the mapkey code anyway:
!/ Type "fdf" to Fix Drawing Font, i.e. change default drawing font to
!/ Arial WGL (ar_wgl__.ttf), and then cycle through up to 100 drawing sheets
!/ updating tables to use the default font. This is useful for upgrading
!/ drawings created with Arial (arial.ttf), which is no longer directly
!/ available with simplified configuration settings after Creo 4 upgrade.
mapkey fdf @MAPKEY_LABELfix drawing font;~ Close `main_dlg_cur` `appl_casc`;\
mapkey(continued) ~ Command `ProCmdDwgProperties` ;\
mapkey(continued) ~ Activate `mdlprops_dlg` `OPTIONS_lay_Controls.push_Change.lay_instance`;\
mapkey(continued) ~ Input `preferences` `InputOpt` `default_annotation_font`;\
mapkey(continued) ~ Update `preferences` `InputOpt` `default_annotation_font`;\
mapkey(continued) ~ FocusOut `preferences` `InputOpt`;~ Input `preferences` `EditPanel` `a`;\
mapkey(continued) ~ Update `preferences` `EditPanel` `ar_wgl__.ttf`;\
mapkey(continued) ~ Activate `preferences` `AddOpt`;~ FocusOut `preferences` `InputOpt`;\
mapkey(continued) ~ Activate `preferences` `ok`;~ Activate `mdlprops_dlg` `DlgClose_push`;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;\
mapkey(continued) %fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;%fdsubroutine;
!/ Subroutine for "fdf" mapkey. Sets all tables on current drawing sheet to use
!/ default font (including page border formats), switches to next drawing sheet, and
!/ pops up a dialog to prompt user if there are more sheets, allowing execution to be halted.
!/ (Note that this creates a temporary layer as a mechanism to select all tables.)
mapkey fdsubroutine @MAPKEY_LABELfix table fonts;\
mapkey(continued) ~ Command `ProCmdMdlTreeSearch` ;\
mapkey(continued) ~ Open `selspecdlg0` `SelOptionRadio`;~ Close `selspecdlg0` `SelOptionRadio`;\
mapkey(continued) ~ Select `selspecdlg0` `SelOptionRadio` 1 `Drawing Table`;\
mapkey(continued) ~ Select `selspecdlg0` `RuleTypes` 1 `All`;\
mapkey(continued) ~ Select `selspecdlg0` `CascadeButton1`;\
mapkey(continued) ~ Close `selspecdlg0` `CascadeButton1`;\
mapkey(continued) ~ Activate `selspecdlg0` `SaveResults`;\
mapkey(continued) ~ Update `save_rules_dlg` `LayNamePanel` `temp_delete_me`;\
mapkey(continued) ~ Activate `save_rules_dlg` `OKBtn`;~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ Command `ProCmdViewLyrs` 1;\
!/ next 3 lines for users with floating layer tree\
mapkey(continued) ~ Select `layer_dlg_cur` `PHLayerUI.AssyTree` 1 `node0:TEMP_DELETE_ME`;\
mapkey(continued) ~ RButtonArm `layer_dlg_cur` `PHLayerUI.AssyTree` `node0:TEMP_DELETE_ME`;\
mapkey(continued) ~ Close `layer_dlg_cur` `LayerActionMenu`;\
!/ next 2 lines alternate version for users without floating layer tree\
mapkey(continued) ~ Select `main_dlg_cur` `LayersAssyTree` 1 `node0:TEMP_DELETE_ME`;\
mapkey(continued) ~ RButtonArm `main_dlg_cur` `LayersAssyTree` `node0:TEMP_DELETE_ME`;\
!/ common section\
mapkey(continued) ~ Command `ProCmdLayer_SelectItems` ;\
mapkey(continued) ~ Activate `main_dlg_cur` `page_Layout_control_btn` 1;\
mapkey(continued) ~ Command `ProCmdDwgModTextStyle` ;\
mapkey(continued) ~ Activate `dial_txt_sty_asynch` `chk_usedeffont` 1;\
mapkey(continued) ~ Activate `dial_txt_sty_asynch` `psh_ok`;\
!/ next 2 lines for users with floating layer tree\
mapkey(continued) ~ Select `layer_dlg_cur` `PHLayerUI.AssyTree` 1 `node0:TEMP_DELETE_ME`;\
mapkey(continued) ~ RButtonArm `layer_dlg_cur` `PHLayerUI.AssyTree` `node0:TEMP_DELETE_ME`;\
!/ next 2 lines alternate version for users without floating layer tree\
mapkey(continued) ~ Select `main_dlg_cur` `LayersAssyTree` 1 `node0:TEMP_DELETE_ME`;\
mapkey(continued) ~ RButtonArm `main_dlg_cur` `LayersAssyTree` `node0:TEMP_DELETE_ME`;\
!/ common section\
mapkey(continued) ~ Command `ProCmdLayer_DelLay` ;~ FocusIn `UI Message Dialog` `yes`;\
mapkey(continued) ~ Activate `UI Message Dialog` `yes`;\
mapkey(continued) ~ Activate `main_dlg_cur` `page_View_control_btn` 1;\
mapkey(continued) ~ Command `ProCmdViewLyrs` 0;\
mapkey(continued) ~ Command `ProCmdDwgGotoSheet` ;\
mapkey(continued) ~ FocusOut `gotosheet` `InpPagenum`;~ Activate `gotosheet` `Next`;\
mapkey(continued) ~ Activate `gotosheet` `Close`;\
mapkey(continued) @MANUAL_PAUSEIf this is the sheet where you started, click \
mapkey(continued) Cancel.\n\nOtherwise, click Resume to fix this sheet and move on to next.;