try running only this:
foreach $tp in filter(folder('toolpath'),'this.RootType == "toolpath"') {
if $tp.Safety.Holder.Cutting.Status == 'collides' or $tp.Safety.Holder.Leads.Status == 'collides' or $tp.Safety.Holder.Links.Status == 'collides' or $tp.Safety.Tool.Cutting.Status == 'collides' or $tp.Safety.Tool.Leads.Status == 'collides' or $tp.Safety.Tool.Links.Status == 'collides' {
string $newName = $tp.Name + "_COLLISION"
if entity_exists('toolpath',$newName) {
$newName = new_entity_name('toolpath',$newName)
}
RENAME Toolpath ${tp.Name} ${newName}
}
}
i just added my code at the end of your macro
if this works heres the complere macro:
DIALOGS MESSAGE OFF
DIALOGS ERROR OFF
GRAPHICS LOCK
FOREACH tp IN folder('Toolpath') {
IF NOT tp.Computed {
ACTIVATE TOOLPATH $tp.Name
EDIT TOOLPATH $tp.Name CALCULATE
}
}
FOREACH tp IN folder('Toolpath') {
ACTIVATE TOOLPATH $tp.Name
ACTIVATE StockModel "P#01 - STM_Blank milling_1"
EDIT COLLISION TYPE COLLISION
EDIT COLLISION STOCKMODEL_CHECK Y
EDIT COLLISION STOCKMODEL "P#01 - STM_Blank milling"
EDIT COLLISION SCOPE ALL
EDIT COLLISION SPLIT_TOOLPATH N
EDIT COLLISION MISS_OUTPUT N
EDIT PAR 'Verification.UseVerificationThickness' 0
EDIT COLLISION HEAD_CLEARANCE "600.0"
EDIT COLLISION HOLDER_CLEARANCE "1.0"
EDIT COLLISION SHANK_CLEARANCE "0.3"
EDIT COLLISION DEPTH Y
EDIT COLLISION ADJUST_TOOL N
UNDRAW COLLISION
EDIT COLLISION APPLY
EDIT STOCKMODEL ; INSERT_INPUT TOOLPATH $tp.Name LAST
EDIT STOCKMODEL "P#01 - STM_Blank milling_1" CALCULATE
}
foreach $tp in filter(folder('toolpath'),'this.RootType == "toolpath"') {
if $tp.Safety.Holder.Cutting.Status == 'collides' or $tp.Safety.Holder.Leads.Status == 'collides' or $tp.Safety.Holder.Links.Status == 'collides' or $tp.Safety.Tool.Cutting.Status == 'collides' or $tp.Safety.Tool.Leads.Status == 'collides' or $tp.Safety.Tool.Links.Status == 'collides' {
string $newName = $tp.Name + "_COLLISION"
if entity_exists('toolpath',$newName) {
$newName = new_entity_name('toolpath',$newName)
}
RENAME Toolpath ${tp.Name} ${newName}
}
}
DIALOGS MESSAGE ON
DIALOGS ERROR ON
GRAPHICS UNLOCK