Skip to main content
13-Aquamarine
Dec 15, 2023 10:44 AM UTC
Solved

Pause for keyboard input in mapkeys

Hello,

 

I want to know if we can pause for keyboard input in mapkeys like we did in the link below but for the popup window that appears when we do File/Save as in order to change the name of the file.

https://community.ptc.com/t5/Customization/Pause-for-keyboard-input-in-mapkeys/td-p/419676

 

My goal is to create a macro which transform an .asm file into an .iges file and pause in the middle of the macro to ask for the user's input to change the name of the file

Chris3
Chris3Answer
21-Topaz I
Dec 15, 2023 12:12 PM UTC

When recording the mapkey, just hit the pause button in the dialog box. It will ask you to type in a "resume prompt" which is what the mapkey user will see while its paused.

 

Alternatively you can just manually edit the mapkey and insert this:

 

mapkey(continued) @MANUAL_PAUSEPrompt Goes Here;\

9 replies

Chris3
Chris321-Topaz IAnswer
21-Topaz I
Dec 15, 2023 12:12 PM UTC

When recording the mapkey, just hit the pause button in the dialog box. It will ask you to type in a "resume prompt" which is what the mapkey user will see while its paused.

 

Alternatively you can just manually edit the mapkey and insert this:

 

mapkey(continued) @MANUAL_PAUSEPrompt Goes Here;\
Translate
Chris3
21-Topaz I
Dec 15, 2023 12:13 PM UTC

Pause button:

Capture.PNG

Translate
SR_CAD13-AquamarineAuthor
13-Aquamarine
Dec 18, 2023 9:04 AM UTC

Hi, thank you for the response, it works. Also, is there a way to select and open the last .igs file created in a macro ?

Translate
tbraxton
22-Sapphire II
Dec 15, 2023 12:17 PM UTC

Yes, this is possible. A mapkey to execute this iges export macro is posted below.

 

mapkey $F6 ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `main_dlg_w1:PHTLeft.AssyTree:<NULL>`;~ Close `main_dlg_cur` `appl_casc`;\
mapkey(continued) ~ Command `ProCmdModelSaveAs` ;~ Open `file_saveas` `type_option`;\
mapkey(continued) ~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_134`;\
mapkey(continued) @MANUAL_PAUSEEnter export file name;~ Activate `file_saveas` `OK`;

 

Translate
SR_CAD13-AquamarineAuthor
13-Aquamarine
Dec 18, 2023 9:06 AM UTC

Hi, thank you for the code. I tried to modify it in order to open the .igs file created but I didn't manage to select the good one, is there a way ?

Translate
tbraxton
22-Sapphire II
Dec 18, 2023 12:20 PM UTC

AFAIK this is not possible with mapkey functionality. You would need to call an external script to get the file name and then pass that back to the Creo UI in order to execute this.

 

A workaround would be to create a mapkey that would open .igs files from the working directory and nest this with the .igs export  mapkey you already have. This would require the user to select which .igs to open from a list of all .igs in the working directory.

Translate