|
楼主 |
发表于 2022-8-24 17:50:52
|
显示全部楼层
本帖最后由 destiny0515 于 2022-8-29 15:35 编辑
foreach i $group_list j $tool_list k $next_tool_list l $offset_list m $info_list {
MOM_output_literal "T$j M6 (TOOL_NAME:$m)"
MOM_output_literal "T$k"
MOM_output_literal "G$l"
MOM_output_literal "M98 P$i"
}
以上为原帖中的代码,每次迭代都会输出换刀指令。foreach i $group_list j $tool_list k $next_tool_list l $offset_list m $info_list {
if {![info exists tool_number_saved] || ([info exists tool_number_saved] && [string compare $tool_number_saved $j])} {
MOM_output_literal "T$j M6 (TOOL_NAME:$m)"
MOM_output_literal "T$k"
}
MOM_output_literal "G$l"
MOM_output_literal "M98 P$i"
set tool_number_saved $j
}
以上为增加了输出换刀时的条件,可能会帮助到你。
|
|