cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Pause for keyboard input in mapkeys

SR_CAD
13-Aquamarine

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

ACCEPTED SOLUTION

Accepted Solutions
Chris3
21-Topaz I
(To:SR_CAD)

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

View solution in original post

9 REPLIES 9
Chris3
21-Topaz I
(To:SR_CAD)

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
(To:Chris3)

Pause button:

Capture.PNG

SR_CAD
13-Aquamarine
(To:Chris3)

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 ?

Chris3
21-Topaz I
(To:SR_CAD)

Sure of you don't mind changing the filename. If not then as @tbraxton says you would need an outside script to do it (BTW - I am presenting on outside scripts at the PTC conference in Jan). I have a script that does this for images. It looks at the time stamps and opens the last one that I saved for editing.

 

If you don't mind changing the filename, then just have your mapkey save to a unique folder:

 

c:\workingdirectory\temp\export.igs

 

and make sure you record it a second time so you get the overwrite prompt recorded in the mapkey. Then to open it, just open the same file.

SR_CAD
13-Aquamarine
(To:Chris3)

Hi,

I do mind changing the filename. I would not mind if I needed to copy the file name before doing the macro in order to have the macro do a CTRL+V (or Right clic / Paste) to find the file. But when I record this operation, Creo doesn't note it (whereas when I use CTRL+C, it does).

Is there a way to tell Creo to do that ?

tbraxton
22-Sapphire I
(To:SR_CAD)

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

 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
SR_CAD
13-Aquamarine
(To:tbraxton)

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 I
(To:SR_CAD)

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.

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
SR_CAD
13-Aquamarine
(To:tbraxton)

Hi,

 

Indeed, one way to solve this would be to add another pause to let the user select which file to open.

Also, do you know if it's possible to do CTRL+V (or Right clic / Paste) in a macro (doesn't work when I record it) ?

Announcements


Top Tags