Hi,
I created a Mapkey just to test, to open a .prt and save as .stp and close
mapkey f13 @MAPKEY_NAMEdemo;@MAPKEY_LABELdemo;~ 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:curvedriven_pattern.prt`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
but I have some other files needs the same operations. so i copy in a notepad, multiply find and replace and did this
mapkey f14 @MAPKEY_NAMEdemo;@MAPKEY_LABELdemo;~ 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:curvedriven_pattern.prt`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
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:curvedriven_pattern.prt`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_2.prt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_2.prt`;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
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:curvedriven_pattern.prt`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_3.prt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_3.prt`;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
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:curvedriven_pattern.prt`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_4.prt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_4.prt`;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
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:curvedriven_pattern.prt`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_5.prt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_5.prt`;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
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:curvedriven_pattern.prt`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_6.prt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_6.prt`;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
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:curvedriven_pattern.prt`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_7.prt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_7.prt`;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
and i got error like this.
is there any way to fix this?
Please see the attachments as my config2 is working but config3 is not. WHY?
Solved! Go to Solution.
Thanks for the reply. I figured it out.
Not a direct answer to your question, but in the past, when I've had to do a similar task (create 100s of dxf files from drawings) I used a trail file. Here's a previous discussion where I detailed what I did:
Previous Trail File Discussion
Others will advocate using Pro Batch to perform such tasks, but I've not enjoyed using that in the past.
Thanks for the reply. I figured it out.
The red circle with a line through it means that line of the mapkey was not read in correctly. This is often because there was a misplaced or forgotten ending \ or ; character somewhere. You can look at the value column to understand what line if your code the mapkey is failing at and then try and troubleshoot it from there.
I didn't look though your config but it seems that you have extra lines in your mapkey that are not needed. It appears in your original mapkey you had curvedriven_pattern.prt highlighted and then deselected it. There is no reason to keep repeating this over and over. Try this:
From:
mapkey(continued) ~ 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:curvedriven_pattern.prt`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\
To:
mapkey(continued) ~ Command `ProCmdModelOpen` ;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Input `file_open` `Inputname` `base_gear_1.prt`;\
mapkey(continued) ~ Update `file_open` `Inputname` `base_gear_1.prt`;\
In the future it is better to paste in filenames and paths into the file open dialog box rather than picks with the mouse.
Thanks for sharing. I will paste in filenames and paths into the file open dialog box rather than pick with the mouse. I already figured out.
Solved: Re: How to loop a mapkey? - PTC Community
@RG_10671499 wrote:
Hi,
I created a Mapkey just to test, to open a .prt and save as .stp and close
mapkey f13 @MAPKEY_NAMEdemo;@MAPKEY_LABELdemo;~ 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:curvedriven_pattern.prt`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\ mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\ mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\ mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\ mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
but I have some other files needs the same operations. so i copy in a notepad, multiply find and replace and did this
mapkey f14 @MAPKEY_NAMEdemo;@MAPKEY_LABELdemo;~ 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:curvedriven_pattern.prt`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_1.prt`;\ mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\ mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\ mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\ mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`; 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:curvedriven_pattern.prt`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_2.prt`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_2.prt`;\ mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\ mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\ mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\ mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`; 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:curvedriven_pattern.prt`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_3.prt`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_3.prt`;\ mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\ mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\ mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\ mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`; 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:curvedriven_pattern.prt`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_4.prt`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_4.prt`;\ mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\ mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\ mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\ mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`; 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:curvedriven_pattern.prt`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_5.prt`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_5.prt`;\ mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\ mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\ mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\ mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`; 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:curvedriven_pattern.prt`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_6.prt`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_6.prt`;\ mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\ mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\ mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\ mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`; 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:curvedriven_pattern.prt`;\ mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \ mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\ mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `base_gear_7.prt`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `base_gear_7.prt`;\ mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `EmbedBrowserTimer`;\ mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\ mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\ mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_539`;\ mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdWinCloseGroup`;
and i got error like this.
is there any way to fix this?
Please see the attachments as my config2 is working but config3 is not. WHY?
Hi,
in your f14 mapkey some information is missing. See area with yellow background.