Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
I would like to create a map key to save a file to the current working directory\Release with the current date. Is there a way to do this with a variable? ie %CWD\Release\filename.%mm%dd%yy.pdf
It is possible to call an external script from within a mapkey. I think you would need to use this function in order to achieve this using a mapkey. Refer to this thread for examples.
It doesn't look like an external script understands what the Current Working Directory is outside of Creo.
I am pretty sure that the APIs have calls that will return the current working directory. The VB and J-Link API is part of every Creo license so that could be one option for you.
I gave a PTC User presentation a couple of years ago on creating dynamic mapkeys:
https://community.ptc.com/sejnu66972/attachments/sejnu66972/customization/13797/1/VG-4052%20Dynamic%20Mapkeys%20to%20Automate%20Creo%202024-01-23.pdf
Read through that. The start in directory can be obtained from the text file generated from File-> Help -> System Information -> System Information
Note that the start in directory is different than the working directory. Do you really need the working directory? For my scripts I just have a fixed folder that I write everything to. That support.inf file is written to the working directory, so if you really needed the working directory, you could write a script that searched through folders for that file and then return that path.
Hi @ptc-292364,
I wanted to see if you got the help you needed.
If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation.
Thanks,
Anurag
