通过使用条件表达式,让 PowerMill 在无法解析参数时,“设置清单”域将不为空,而显示有意义的预定义值。例如,如果存在错误或您忘记指定刀具路径的工作平面,这会非常有用。如果不使用条件表达式,PowerMill 将无法解析参数,“工作平面名称”域将为空且原因未知。
下例说明如何通过编辑参数 toolpath.Workplane 来包含一个条件表达式,从而在 PowerMill 无法解析该参数时,显示值“WORLD”。
基本参数:
<th> Workplane Name</th><td>${toolpath.Workplane}</td>
编辑参数,如下所示:
<td> Workplane Name</th><td>${select(error(toolpath.Workplane), "WORLD", "$toolpath.Workplane.Name")}</td>
条件表达式包含一个问题、两个答案:
在此刀具路径工作平面示例中,问题 ${select(error(toolpath.Workplane) 询问“刀具路径工作平面是否存在?”
如果答案为“否。没有工作平面”。PowerMill 会打印预定义值“WORLD”。如果答案为“是。存在一个工作平面”。PowerMill 会打印参数字符串 toolpath.wokplane.name 的结果。
在您自己编写条件表达式时,请使用以下结构:
${select(error(parameter in question), "value displayed if parameter cannot be resolved", "$parameter to be displayed if <PRODUCt> can resolve parameter")}