Skip to Main Content
Cognex 지원 허브
LogoLogo

Enable/Disable QuickBuild Tools Programatically

Step-by-step guide for controlling the status of VisionPro QuickBuild tools via programmatic interactions

2024. 09. 14.

Question

How can I control from a script or other programming interface whether a tool in Quickbuild runs?

Answer

Every CogJob has a CogToolGroup which contains its Tools. You can access the ToolGroup via the VisionTool property of the CogJob.

Once you have a reference to the CogToolGroup (you will need to cast the generic type reference returned by CogJob.VisionTool to a CogToolGroup) you can disable a tool by adding a reference to it to the DisabledTools Collection.
 

Example:

myToolGroup.DisabledTools.Add(myToolGroup.Tools[0]);

This will disable the very first tool in the ToolGroup.

To enable the tool you would simply remove the tool reference from the disabled tools.

관련 자원