VisionPro之工具块-ToolBlock高级脚本之读取输出模板匹配结果
获取模板匹配的结果数据
usingCognex.VisionPro.PMAlign;publicoverrideboolGroupRun(refstringmessage,refCogToolResultConstantsresult){// To let the execution stop in this script when a debugger is attached, uncomment the following lines.// #if DEBUG// if (System.Diagnostics.Debugger.IsAttached) System.Diagnostics.Debugger.Break();// #endif// Run each tool using the RunTool functionforeach(ICogTooltoolinmToolBlock.Tools)mToolBlock.RunTool(tool,refmessage,refresult);varx=mToolBlock.Outputs["X"].Value;mToolBlock.Outputs["Output"].Value=x;returnfalse;}