Skip to main content
13-Aquamarine
December 15, 2023
Solved

Pause for keyboard input in mapkeys

  • December 15, 2023
  • 2 replies
  • 3238 views

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

Best answer by Chris3

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

2 replies

Chris3
Chris321-Topaz IAnswer
21-Topaz I
December 15, 2023

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;\
Chris3
21-Topaz I
December 15, 2023

Pause button:

Capture.PNG

SR_CAD13-AquamarineAuthor
13-Aquamarine
December 18, 2023

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 ?

tbraxton
22-Sapphire II
22-Sapphire II
December 15, 2023

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

 

SR_CAD13-AquamarineAuthor
13-Aquamarine
December 18, 2023

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 ?

tbraxton
22-Sapphire II
22-Sapphire II
December 18, 2023

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.