The PTC Community will be on read only status starting March 23rd in preparation for moving our platform to a new provider. Read more here
Hello all,
I have a mapkey (ex) that opens the windows explorer in the working directory. I have recently switched to directory opus as an alternative explorer. I would like to make a macro that launches directory opus in the working directory. Do you know how I could achieve that ? How would you do ?
Thanks.
Solved! Go to Solution.
Thanks all for your help.
Finally I made it using Autohotkey. The only thing, I had to add a few pause in the script (Sleep command) because the script was too fast to copy the working directory. Sometimes it was working, sometimes not. Now it works 100%. 😁
I had never used Autohotkey before, it's quite easy to learn.
Here's the script if anyone is interested.
!e:: ; Raccourci ALT+E
Send {Alt}
Send f
Send m
Send w
Send {Tab}
Send {Tab}
Sleep 100
Send {Space}
Sleep 100
Send ^c
Sleep 100
Send {Esc}
Run, dopus.exe "%Clipboard%"
return
Maybe this past discussion is helpful?
https://community.ptc.com/t5/Customization/How-to-open-external-file-with-Mapkey/td-p/438675
Thanks for the tip. I'm just wondering how I could pass the working directory as argument to my command line ?
If you refer to this Directory Opus, you might as well request assistance to them directly.
I know that Direct Folders from Code Sector enables to switch browse automatically like :
The workflow is a little different but it saves lots of clicks.
There may be an easier way to do this, but this way would work:
1. You have a mapkey that calls File-> Help -> System information -> System information
2. In the message window it will display the path of your working directory along with the file support.inf.1
3. You mapkey opens the message log (Tools -> Message Log) and then saves that message log file to a text file with a known file path.
3. You mapkey calls a vbs file that opens the message log file in step 3 above and extracts the working directory path from the message log and then hands that path off to your other program to open.
I gave a PTC/User presentation that walks through some of these steps here:
https://community.ptc.com/sejnu66972/attachments/sejnu66972/customization/13797/1/VG-4052%20Dynamic%20Mapkeys%20to%20Automate%20Creo%202024-01-23.pdf
This may help you. When you use "Open System Window" to open a command prompt in the current session it always opens to the location of the working directory.
Thanks all for your help.
Finally I made it using Autohotkey. The only thing, I had to add a few pause in the script (Sleep command) because the script was too fast to copy the working directory. Sometimes it was working, sometimes not. Now it works 100%. 😁
I had never used Autohotkey before, it's quite easy to learn.
Here's the script if anyone is interested.
!e:: ; Raccourci ALT+E
Send {Alt}
Send f
Send m
Send w
Send {Tab}
Send {Tab}
Sleep 100
Send {Space}
Sleep 100
Send ^c
Sleep 100
Send {Esc}
Run, dopus.exe "%Clipboard%"
return
I think this will help you a lot! You can change path to your dopus.exe instead of my batch file
mapkey xd @MAPKEY_LABELautoimport;~ Command `ProCmdDwgTblSaveasText` ;\
mapkey(continued)\ @SYSTEM "C:\\Users\\Admin\\Desktop\\personal\\autoimport\\tpv.bat";
Thanks for the tip, but for now it doesn't work.
I wrote this in mapkey file
mapkey ed @MAPKEY_LABELOuvrir directory opus dans répertoire de travail;~ Command `ProCmdDwgTblSaveasText` ;\
mapkey(continued)\ @SYSTEM "C:\\Program Files\\GPSoftware\\Directory Opus\\dopus.exe";
It does open directory opus but not in the working directory.
I also get this message in the status bar in Creo :
14:18 Erreur de macro clavier : Invalid trail file line : No palette found for command 'ProCmdDwgTblSaveasText' in context 'context_main_dlg_w1'.
