Hi
Using Creo 10.0.1.0
Trying to setup a Mapkey to output a PDF using pentable & the File Export options
That side of things works fine, What we want to do is grab the current working directory & save to a file, change the working directory to a temporary directory (dependant on the user name) , output the pdf, then change the working directory back.
I have the following mapkey, it runs the script, the -trail.txt file is created into the "E:\Configs\mapkey"
Most of this i generated by recording a mapkey.
Spoiler (Highlight to read) mapkey pdf @MAPKEY_LABELOutput PDF;\ mapkey(continued) @SYSTEMstart E:\\Configs\\mapkey\\change_dir.bat "\%cd\%";\ mapkey(continued) ~ Activate `main_dlg_cur` `File.psh_working_dir`;\ mapkey(continued) ~ Activate `file_open` `Inputname` `E:\\Temp\\\\$USERNAME`;\ mapkey(continued) ~ Activate `file_open` `Open`;\ mapkey(continued) ~ Command `ProCmdExportPreview` ;~ Command `ProCmdDwgPubSettings` ;\ mapkey(continued) ~ Activate `intf_profile` `pdf_export.pdf_pentable` 0;\ mapkey(continued) ~ Activate `intf_profile` `pdf_export.pdf_pentable` 1;\ mapkey(continued) ~ Activate `intf_profile` `OkPshBtn`;~ Command `ProCmdDwgPubExport` ;\ mapkey(continued) ~ Activate `file_saveas` `OK`; mapkey(continued) ~ Activate `main_dlg_cur` `Utilities.psh_util_trail_train`;\ mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist`1 \ mapkey(continued) `E:\\Configs\\Mapkey\\~trail.txt`;
mapkey pdf @MAPKEY_LABELOutput PDF;\mapkey(continued) @SYSTEMstart E:\\Configs\\mapkey\\change_dir.bat "\%cd\%";\mapkey(continued) ~ Activate `main_dlg_cur` `File.psh_working_dir`;\mapkey(continued) ~ Activate `file_open` `Inputname` `E:\\Temp\\\\$USERNAME`;\mapkey(continued) ~ Activate `file_open` `Open`;\mapkey(continued) ~ Command `ProCmdExportPreview` ;~ Command `ProCmdDwgPubSettings` ;\mapkey(continued) ~ Activate `intf_profile` `pdf_export.pdf_pentable` 0;\mapkey(continued) ~ Activate `intf_profile` `pdf_export.pdf_pentable` 1;\mapkey(continued) ~ Activate `intf_profile` `OkPshBtn`;~ Command `ProCmdDwgPubExport` ;\mapkey(continued) ~ Activate `file_saveas` `OK`;mapkey(continued) ~ Activate `main_dlg_cur` `Utilities.psh_util_trail_train`;\mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist`1 \mapkey(continued) `E:\\Configs\\Mapkey\\~trail.txt`;
And the below is a script to write the directory to a file
Spoiler (Highlight to read) @echo off
set curdir=%~f1 set procurdir=%curdir:\=\\% set trailpath=E:\Configs\mapkey set trailfile=~trail.txt
cd /d "%trailpath%"
echo.^!Adams PDF Exporter>"%trailfile%" echo.~ Activate `main_dlg_cur` `File.psh_working_dir`>>"%trailfile%" echo.~ Activate `file_open` `Inputname` \>>"%trailfile%" echo. `%procurdir%`>>"%trailfile%" echo.~ Activate `file_open` `Open`>>"%trailfile%"
exit
offset curdir=%~f1set procurdir=%curdir:\=\\%set trailpath=E:\Configs\mapkeyset trailfile=~trail.txtcd /d "%trailpath%"echo.^!Adams PDF Exporter>"%trailfile%"echo.~ Activate `main_dlg_cur` `File.psh_working_dir`>>"%trailfile%"echo.~ Activate `file_open` `Inputname` \>>"%trailfile%"echo. `%procurdir%`>>"%trailfile%"echo.~ Activate `file_open` `Open`>>"%trailfile%"exit
It appeared to be initially working on my system, but then not on others, and now doesnt work on mine, it just outputs the pdf to the current working directory. Unsure if im using the wrong parameters or if theres a better way to achieve this.