- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good Day,
I'm trying to create this macro to export selected tools as *.ptf files to a location and drop them into folders based on their tool type, but It's not working for me, any ideas where I'm going wrong.
Thanks Jon K
DIALOGS MESSAGE OFF
DIALOGS ERROR OFF
GRAPHICS LOCK
IF $length(project_pathname(0)) == 0 {
MESSAGE WARN 'Save project first.'
MACRO ABORT ALL
}
IF $SIZE(folder('tool')) == 0 {
MESSAGE WARN 'No tools in project.'
MACRO ABORT ALL
}
PROJECT SAVE
STRING $pmlprj_content = ""
FOREACH $tl IN explorer_selected_entities() {
IF $tl.type == 'tip_radiused' {
STRING $template_path = "C:\Powermill\Template Objects\Tools\Tip Radiused"
}ELSE IF $tl.type == 'routing' {
STRING $template_path = "C:\Powermill\Template Objects\Tools\Routing"
STRING $tool_name = "x" + $tl.ID + ".pmlent"
STRING $tool_name_new = $tl.Name + ".ptf"
STRING $tool_full = project_pathname(0) + "\" + $tool_name
STRING $dest_path_full = $template_path + "\" + $tool_name_new
COPY FILE $tool_full $dest_path_full
}
}
DIALOGS MESSAGE ON
DIALOGS ERROR ON
GRAPHICS UNLOCK
Solved! Go to Solution.