Removes the custom pen with the specified Key. The Key must be an existing simple or interactive pen key that is not in use.
Namespace: Cognex.VisionProAssembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 65.1.0.0
Syntax
Parameters
- key
- Type: System Int32
The pen key of the pen to remove.
Events
| Event Type | Reason |
|---|---|
| CogGeneralContour Changed | Fires when the pen is removed. The following state flags may be affected: |
Exceptions
| Exception | Condition |
|---|---|
| CogShapePenKeyInUseException | The pen with the specified key is in use. |
| ArgumentException | key is not a known pen key. |
Remarks
Removes the custom pen with the specified key. The key must be an existing simple or interactive pen key that is not in use.
A pen key is considered in use if either of the following statements is true:
A simple pen key is referenced by an interactive pen, even if the interactive key is not in use.The pen key is referenced in any part of the shape that can hold a pen key.Specifically, a pen key is in use if it is a segment's CustomPen, StartAdornmentCustomPen, EndAdornmentCustomPen, or used by any interactive pen.
See Also