cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Translate the entire conversation x

Create mapkey with a variable to save a .pdf to a path and date

ptc-292364
6-Contributor

Create mapkey with a variable to save a .pdf to a path and date

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

5 REPLIES 5
tbraxton
22-Sapphire II
(To:ptc-292364)

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.

 

https://community.ptc.com/t5/Customization/How-to-call-a-external-applications-using-OS-script-mapkey/td-p/647527 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
ptc-292364
6-Contributor
(To:tbraxton)

It doesn't look like an external script understands what the Current Working Directory is outside of Creo.

tbraxton
22-Sapphire II
(To:ptc-292364)

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.

 

https://support.ptc.com/help/creo_toolkit/vbapi_plus/usascii/index.html#page/creo_toolkit/user_guide/Directories.html 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
Chris3
21-Topaz I
(To:ptc-292364)

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

Announcements
NEW Creo+ Topics: PTC Control Center and Creo+ Portal

Top Tags