//renames toolpaths in the active folder adding the folder name as a prefix reset localvars INCLUDE "C:/dcam/pmill4/Macros/functions.pm4" FUNCTION MAIN() { GRAPHICS LOCK //get the name of the active folder STRING $folderName = active_folder() FOREACH tp in folder ($folderName) { //get the pathname STRING path = pathname(tp) //get the lowest folder name from the path STRING type = basename(dirname(path)) //get the nex lowest folder name STRING feat = basename(dirname(dirname(path))) //get the toolpath name STRING base = basename(path) RENAME TOOLPATH $base ${type + "-" + base} } GRAPHICS UNLOCK }