Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
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
Solved! Go to Solution.
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;\
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;\
Pause button:
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 ?
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.
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 ?
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`;
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 ?
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.
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) ?