Skip to main content
Dale_Rosema
23-Emerald III
23-Emerald III
August 15, 2022
Solved

Mapkey Pause for Input

  • August 15, 2022
  • 5 replies
  • 13182 views

In creating a mapkey to save a pdf.

File SaveAs (Alt-F, A)

Type (pick the drop down and chose .pdf)

The file name appears in the File Name box. (e.g. abc123)

Due to quirky things where I work, I need to add a "v" in front of the name (legacy stuff).

 

I try "Pause for input" add the "v" and resume the mapkey.

Now the mapkey wants to create all the .pdf's with the name of the file when I created the mapkey (e.g. vabc123).

 

After this I chose the PDF profile and complete the mapkey.

 

Is there a way to either set the profile with an independent mapkey at the beginning of the Creo session or continue without the filename used when creating the mapkey.

 

If I could pre-set the PDF profile, I could stop recording the mapkey after the Filename pops up.

 

 

This gave me a partial understanding of :Pausing for Input":

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

Best answer by mkajdan

This is how our mapkey runs.

 

File

Save As

Export

PDF is selected in Export Setup

Settings

At the top of the Settings dialog, where it says "Current Profile", use the pull down arrow to change it to your saved profile

Okay button

Export button

After this a window will pop up to name the file.  If you want to change the default name like I believe you mentioned in another post, this is where you want to pause the mapkey so you can add the additional text, I think it was a "v" if i remember correctly.  Keep the mapkey paused until you enter in the file name and hit the OK button, then resume the mapkey.  This will eliminate the problem you have with all your pdf's having the same name.

 

We don't need to change the name so no pause and the mapkey selects OK here.

 

After OK above I also added the following to get back to where I started from.

Close Export Setup button

Then the mapkey takes me back to the tab where my PDF export mapkey resides in the UI, this saves a couple clicks.

 

5 replies

tbraxton
22-Sapphire II
22-Sapphire II
August 15, 2022
  • Default settings in PDF Export Settings window cannot be changed

However, when you save a PDF export profile it should be written as a *.DOP file in the working directory. You should be able to record a mapkey that would load this saved profile as part of the sequence.

 

 

See: https://www.ptc.com/en/support/article/CS21152 

 

Also Pro/Batch works  with an external profile definition (.dop)

 

See: https://www.ptc.com/en/support/article/CS33456 

Dale_Rosema
23-Emerald III
23-Emerald III
August 15, 2022

From @TomU  last post in this article, once set in a session, it becomes the "current setting" and does not need to be selected until a new session of Creo is started. I have verified this. So I just want to run a mapkey to make it the current setting.

 

https://community.ptc.com/t5/3D-Part-Assembly-Design/export-default-pdf/m-p/175767

23-Emerald IV
August 15, 2022

Several config options have been added that allow certain PDF export settings to be pre-configured.  Depending on what else you need to change, these may be enough to avoid needing to mess with .DOP files.

  • intf2d_out_pdf_stroke_text_font
  • pdf_linecap
  • pdf_linejoin
  • pdf_use_pentable  (and the corresponding pen_table_file option)

TomU_0-1660577015804.png TomU_1-1660577027262.png

 

mkajdan
14-Alexandrite
August 15, 2022

See my reply to your other thread.  You have to keep the mapkey paused until you add the "v" and select the OK button to close the Save As window.  Then resume the mapkey.

mkajdan
mkajdan14-AlexandriteAnswer
14-Alexandrite
August 15, 2022

This is how our mapkey runs.

 

File

Save As

Export

PDF is selected in Export Setup

Settings

At the top of the Settings dialog, where it says "Current Profile", use the pull down arrow to change it to your saved profile

Okay button

Export button

After this a window will pop up to name the file.  If you want to change the default name like I believe you mentioned in another post, this is where you want to pause the mapkey so you can add the additional text, I think it was a "v" if i remember correctly.  Keep the mapkey paused until you enter in the file name and hit the OK button, then resume the mapkey.  This will eliminate the problem you have with all your pdf's having the same name.

 

We don't need to change the name so no pause and the mapkey selects OK here.

 

After OK above I also added the following to get back to where I started from.

Close Export Setup button

Then the mapkey takes me back to the tab where my PDF export mapkey resides in the UI, this saves a couple clicks.

 

Dale_Rosema
23-Emerald III
23-Emerald III
August 17, 2022

I decided to go back to SaveAs instead of Export. I stopped my mapkey when the filename popped up. Then I can enter the additional characters needed and then hit enter twice without having to mouse. As much with the keyboard as possible.....   🙂

 

Below is my mapkey:

 

mapkey gfff @MAPKEY_NAMESave DRW as PDF with corrected filename;\
mapkey(continued) @MAPKEY_LABELSaveAs PDF;~ Select `main_dlg_cur` `appl_casc`;\
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_617`;\
mapkey(continued) ~ Activate `file_saveas` `psh_export_opts`;\
mapkey(continued) ~ Open `intf_profile` `opt_profile`;~ Close `intf_profile` `opt_profile`;\
mapkey(continued) ~ Select `intf_profile` `opt_profile` 1 `GIBRALTAR`;\
mapkey(continued) ~ Activate `intf_profile` `OkPshBtn`;

24-Ruby III
August 16, 2022

Hi,

I created mapkey in Creo 4.0

mapkey rr ~ 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_617`;\
mapkey(continued) ~ Activate `file_saveas` `psh_export_opts`;\
mapkey(continued) ~ Open `intf_profile` `opt_profile`;~ Close `intf_profile` `opt_profile`;\
mapkey(continued) ~ Select `intf_profile` `opt_profile` 1 `myprofile`;\
mapkey(continued) ~ Activate `intf_profile` `OkPshBtn`;@MANUAL_PAUSEModify PDF filename;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Activate `intf_profile` `OkPshBtn`;

See creation procedure in mapkey.mp4 video.

Dale_Rosema
23-Emerald III
23-Emerald III
August 16, 2022

Thanks Martin.

 

Similar by different from what @mkajdan suggested.

 

I was just trying to figure out if there was a way to automatically add the "v" in front of the filename, but from what I gather, there is not.

24-Ruby III
August 16, 2022

@Dale_Rosema wrote:

Thanks Martin.

 

Similar by different from what @mkajdan suggested.

 

I was just trying to figure out if there was a way to automatically add the "v" in front of the filename, but from what I gather, there is not.


Hi,

I guess that mapkey functionality does not enable you to automatically add the "v" in front of the filename.

I can imagine being able to run my Creo mapkey with AutoIt and then add the letter v in the AutoIt script. But I don't really want to try...

 

Dale_Rosema
23-Emerald III
23-Emerald III
August 17, 2022

Thanks to all who helped understanding the "Pause for Input" function.

Since I cannot automatically add keystrokes at this time, I just truncated the mapkey to end when the input is required so that I could just hit enter twice after making the changes.

 

Special thanks to:

@mkajdan 

@TomU 

@kdirth 

@MartinHanak 

@tbraxton 

24-Ruby III
August 18, 2022

Hi,

I made a script as part of the AutoIt exercise. See Creo_Save_PDF_2022-08-18_14-11.zip.

The script was tested with Creo 4.0 M140.

save_PDF.mp4 video shows how it works.

Dale_Rosema
23-Emerald III
23-Emerald III
August 18, 2022

Your video looks great.

 

Can someone point me towards some tutorials/post/videos on AutoIt?  (By the way is it Lt or I (eye) t?)

1-Visitor
September 17, 2022

A lot of complicated things in Creo become straightforward if you use some automation script.

 

To solve your problem, I would do as follows:

 

1. Get file name (using script)

2. Using a simple mapkey to export the file to pdf, the pdf file name is the same as the file name (without extension).

3. Locate the pdf file and rename it (using script)

 

With autohotkey, you can assign the function to a shortcut, eg, press Shift + P and everything is done.