有Powermill批量替换最长刀具宏吗
各位大神,有Powermill批量替换最长刀具宏吗 //碰撞检查已选文件夹内的刀路 DIALOGS MESSAGE OFF DIALOGS ERROR OFF STRING ARRAY Opts[]=get_folders('Toolpath') INT i=input CHOICE $Opts "选择要碰撞计算的文件夹:" STRING FolderPath=Opts FOREACH Toolpath in folder(FolderPath) { ACTIVATE Toolpath $Toolpath.name FORM COLLISION EDIT COLLISION TYPE COLLISION EDIT COLLISION SPLIT_TOOLPATH N EDIT COLLISION SHANK_CLEARANCE "0.5" EDIT COLLISION HOLDER_CLEARANCE "0.5" EDIT COLLISION DEPTH Y EDIT COLLISION ADJUST_TOOL Y EDIT COLLISION OVERHANG_ONLY N EDIT PAR 'Verification.AlwaysCreateTool' 1 EDIT COLLISION APPLY COLLISION ACCEPT } real MaxL=max(extract(folder(FolderPath),'tool.Overhang')) string ToolName="" PRINT $FolderPath FOREACH Toolpath in folder(FolderPath) { IF Toolpath.Tool.OverHang==MaxL { $ToolName=Toolpath.Tool.Name BREAK } } IF ToolName!="" { FOREACH TH in folder(FolderPath) { ACTIVATE Tool $ToolName EDIT TOOLPATH $TH.NAME REPLACE_TOOL ; } } DIALOGS MESSAGE ON DIALOGS ERROR ON用这宏可以一键搞定 用外挂不习惯,要是宏可以实现批量替换最长刀具,外挂可以丢掉了 PM自己就能替换刀具啊,我一般是刀路重命名,他会显示最长刀具,然后我再替换 骄阳似我H 发表于 2020-10-16 09:00PM自己就能替换刀具啊,我一般是刀路重命名,他会显示最长刀具,然后我再替换
我也是用PM替换的,但是需要自己一把把刀具查看才能找到最长刀具,然后再替换,刀路重命名可以显示刀长吗 嗯,重命名刀路宏,你想显示啥都有 //碰撞检查已选文件夹内的刀路
DIALOGS MESSAGE OFF
DIALOGS ERROR OFF
STRING ARRAY Opts[]=get_folders('Toolpath')
INT i=input CHOICE $Opts "选择要碰撞计算的文件夹:"
STRING FolderPath=Opts
FOREACH Toolpath in folder(FolderPath) {
ACTIVATE Toolpath $Toolpath.name
FORM COLLISION
EDIT COLLISION TYPE COLLISION
EDIT COLLISION SPLIT_TOOLPATH N
EDIT COLLISION SHANK_CLEARANCE "0.5"
EDIT COLLISION HOLDER_CLEARANCE "0.5"
EDIT COLLISION DEPTH Y
EDIT COLLISION ADJUST_TOOL Y
EDIT COLLISION OVERHANG_ONLY N
EDIT PAR 'Verification.AlwaysCreateTool' 1
EDIT COLLISION APPLY
COLLISION ACCEPT
}
real MaxL=max(extract(folder(FolderPath),'tool.Overhang'))
string ToolName=""
PRINT $FolderPath
FOREACH Toolpath in folder(FolderPath) {
IF Toolpath.Tool.OverHang==MaxL {
$ToolName=Toolpath.Tool.Name
BREAK
}
}
IF ToolName!="" {
FOREACH TH in folder(FolderPath) {
ACTIVATE Tool $ToolName
EDIT TOOLPATH $TH.NAME REPLACE_TOOL ;
}
}
DIALOGS MESSAGE ON
DIALOGS ERROR ON
用这宏可以搞定 楼上是大佬阿
Arvinluo 发表于 2020-10-16 16:02
//碰撞检查已选文件夹内的刀路
DIALOGS MESSAGE OFF
DIALOGS ERROR OFF
谢谢大师,这个宏我已经有了,缺陷就是一次只能选一个刀路文件夹,可惜不能批量使用 骄阳似我H 发表于 2020-10-16 13:31
嗯,重命名刀路宏,你想显示啥都有
确实是不错的办法,谢谢大神
页:
[1]
2