Need macro help to save template to a folder

Need macro help to save template to a folder

johnc4668
Advocate Advocate
986 Views
6 Replies
Message 1 of 7

Need macro help to save template to a folder

johnc4668
Advocate
Advocate

Is there a way to setup a macro to save templates to a certain folder? Right now powermill just brings up the standard powermill window folder but we dont save them there. I need to save it to Z:\Software\PowerMill\Powermill_Templates and have the folder open to this destination. Not a big deal, but this would save our operators some time.

 

2018-08-01_8-32-09.jpg

 

 

0 Likes
Accepted solutions (1)
987 Views
6 Replies
Replies (6)
Message 2 of 7

iamcdn79
Mentor
Mentor

Try adding this to your macro

STRING $Filesave = ""
$Filesave = FILESELECT "file location here"

Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

Message 3 of 7

rafael.sansao
Advisor
Advisor
Accepted solution
STRING $Filesave = ""
$Filesave = FILESELECT "Select template" "*.ptf" "Z:\PATH" //change this path
KEEP ADVTOOLPATH ; $Filesave

Rafael Sansão

OptiNC - www.optinc.tech

EESignature

Message 4 of 7

johnc4668
Advocate
Advocate

@rafael.sansao, worked great thanks! this could work for a template open macro too right? Maybe just change the $filesave to $fileopen? Pm doesnt have an option to open templates from a certain path everytime i believe.

0 Likes
Message 5 of 7

rafael.sansao
Advisor
Advisor

The path string that the "FILESELECT" returns, can be used for anything.

To import a template, use:

STRING $Filesave = ""
$Filesave = FILESELECT "Select template to open" "*.ptf" "Z:\PATH" //change this
IMPORT TEMPLATE PROJECT $Filesave

Rafael Sansão

OptiNC - www.optinc.tech

EESignature

Message 6 of 7

johnc4668
Advocate
Advocate

@rafael.sansao wrote:

The path string that the "FILESELECT" returns, can be used for anything.

To import a template, use:

STRING $Filesave = ""
$Filesave = FILESELECT "Select template to open" "*.ptf" "Z:\PATH" //change this
IMPORT TEMPLATE PROJECT $Filesave

Worked great, thanks!

0 Likes
Message 7 of 7

johnc4668
Advocate
Advocate

@rafael.sansao Tested this macro again and it seems to only save the active toolpath rather than all the toolpaths, workplanes, boundaries, tools, etc. I need this to save everything in the project if possible. 

0 Likes