当前位置: 首页 > 网络知识

VisionPro 编写C#脚本

时间:2026-01-29 09:26:01

1 using System; 2 using Cognex.VisionPro; 3 using Cognex.VisionPro3D; 4 using Cognex.VisionPro.ToolGroup; 5 using System.Windows.Forms; 6 using System.Drawing ; 7 using Cognex.VisionPro.ImageProcessing ; 8 using Cognex.VisionProaliper; 9 10 11 public class UserScript : CogToolGroupBaseScript 12 45 46 #region "When the Current Run Record is Created" 47 public override void ModifyCurrentRunRecord(Cognex.VisionPro.ICogRecord currentRecord) 48 50 #endregion 51 52 #region "When the Last Run Record is Created" 53 // Allows you to add or modify the contents of the last run record when it is 54 // created. For example, you might add cust graphics to the run record here. 55 public override void ModifyLastRunRecord(Cognex.VisionPro.ICogRecord lastRecord) 56 pixel", Radius); 59 ResultLabel.SetXYText(myCircleenterX, myCircleenterY, labelStr); 60 ResultLabelolor = Cognex.VisionProogColorConstants.Blue; 61 ResultLabel.SelectedSpaceName = @"@\Fixture"; 62 toolGroup.AddGraphicToRunRecord(ResultLabel, lastRecord, "Image Source.OutputImage", "script"); toolGroup.AddGraphicToRunRecord(myCircle, lastRecord, "Image Source.OutputImage", "script"); 64 /* 65 Should only be called fr tool group script. Adds a graphic to a specified run record 66 参数一: A CogGraphic object to add 67 参数二: A tree of CogRecords 68 参数三: The name of the specific record where the graphic should be added 69 参数四: A key string used to identify your graphic 70 */ 71 72 for( int i = 0 ;i < myCF.Resultsount 1;i++) 73 78 79 80 } 81 #endregion 82 83 #region "When the Script is Initialized" 84 // Perform any initialization required by your script here 85 public override void Initialize(CogToolGroup host) 86 92 #endregion 93 94 }



上一篇:VisionPro 物体长度测量
下一篇:VisionPro 圆形物体直径测量
C VisionPro
  • 英特尔与 Vertiv 合作开发液冷 AI 处理器
  • 英特尔第五代 Xeon CPU 来了:详细信息和行业反应
  • 由于云计算放缓引发扩张担忧,甲骨文股价暴跌
  • Web开发状况报告详细介绍可组合架构的优点
  • 如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳
  • 美光在数据中心需求增长后给出了强有力的预测
  • 2027服务器市场价值将接近1960亿美元
  • 生成式人工智能的下一步是什么?
  • 分享在外部存储上安装Ubuntu的5种方法技巧
  • 全球数据中心发展的关键考虑因素
  • 英特尔与 Vertiv 合作开发液冷 AI 处理器

    英特尔第五代 Xeon CPU 来了:详细信息和行业反应

    由于云计算放缓引发扩张担忧,甲骨文股价暴跌

    Web开发状况报告详细介绍可组合架构的优点

    如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳

    美光在数据中心需求增长后给出了强有力的预测

    2027服务器市场价值将接近1960亿美元

    生成式人工智能的下一步是什么?

    分享在外部存储上安装Ubuntu的5种方法技巧

    全球数据中心发展的关键考虑因素