Click or drag to resize

IMcProfileEdgesRemoveEdges Method

Remove one or more edges from selected profiles

Namespace:  MediaCy.IQL.Features
Assembly:  MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
Syntax
VB
Function RemoveEdges ( 
	<OptionalAttribute> Distances As Object,
	<OptionalAttribute> Selector As Object,
	Optional CanMissByPixels As Double = 0
) As Integer

Parameters

Distances (Optional)
Type: SystemObject
If not given (i.e., Empty, Error or Null), then all edges are removed from the selected profiles. If the Selector argument is also missing, then all edges are removed from all profiles (see Example). If given, it can be a single scalar value, an array of values or an array of variant, each holding one or an array of values. If the Selector argument is anything other than a single index value, then the Distances must be organized as an array of Variants. For each distance, an edge is removed if one is found at that distance from the start of the profile. If the ProfilesAncestor McLineProfiles.CalibratedLength property is True, then distances must be given in calibrated units. If the CanMissByPixels argument is given and non-zero, then the distance does not have to match exactly that of an existing edge.
Selector (Optional)
Type: SystemObject
An empty variant, a single negative value, a single index value, or an array of zero or more index values (negative index values are legal but will be ignored). If the Selector argument is a non-negative scalar index value, then edges are removed for just the indicated profile. In this case, if it is given, the Distances argument may be either a scalar value or an array of values. The index value must fall between zero and ProfilesAncestor.CountOfProfiles-1. If the Selector argument is Empty, Error or Null, or any negative scalar value, then edges are removed from all ProfilesAncestor.CountOfProfiles profiles. In this case, if it is given, the Distances argument must be an array of Variant, where each Variant is a 1-D array that gives the Distances for the edges to be removed from the profile at the same index. If Selector is an array, then zero or positive values are treated as indices into the ProfilesAncestor profiles, negative values are legal but ignored. In this case, the Distances argument must be an array of Variant, where each Variant is a 1-D array that gives the Distance for the edges to be removed from the profile at the selected index. Index values greater or equal to the ProfilesAncestor.CountOfProfiles property are illegal.
CanMissByPixels (Optional)
Type: SystemDouble
The length, in pixel units, by which a Distances argument value may be off from the actual distance of an edge to be removed. By default CanMissByPixels is zero, so that a distance must match exactly an existing edge for the edge to be removed. However, is CanMissByPixels is non-zero, then the closest edge that is at the given distance plus or minus the CanMissByPixels (in pixels) will be removed; only the closest edge will be removed, even if there are several within this interval. CanMissByPixels is always given in image pixel units, irrespective of the state of the the ProfilesAncestor McLineProfiles.CalibratedLength property (which determines whether the Distance property is given in calibrated units or pixel units). This is because the use for this argument will almost always be to assist with edge editing by the user, where they will need to be able to click close-to but not exactly on an edge they wish to remove. If CanMissByPixels is supplied as a negative value, then the RemoveEdges operation is just a test. In this case, vSelector must not select "all edges". The return value will be either zero, if no edges are within -CanMissByPixels of the specified Distances, or 1 indicating that at least one edge will be removed.

Return Value

Type: Int32
The total number of edges removed from all profiles.
Remarks
This method removes one or more edges from selected profiles. For editing normally, one edge will be removed at a time from one profile. But the method may also be used to remove all edges from one, selected or all profiles (see Example). If any edges are removed then an McObjMgr McObjStandardNotify.SpecialNotify is fired on the McObject backing this McProfileEdges. The notify code will be SNC_NOTIFY_HO_PROPERTYCHANGED and the notify data will be ID_IMcProfileEdges_EdgeCounts. You can use an instance of McNotifySink WithEvents in VBA to track these notifies.
Examples
VB
With ThisApplication.ActiveImage.LineFeatures.Profiles.ProfileEdges
'Remove an edge that is 20 units +/- 5 pixels from the start
.RemoveEdges 20, 0, 5 'do it on profile 0
.RemoveEdges ,Array(0,1) 'remove all edges from profiles 0 and 1
.RemoveEdges 'remove all edges from all profiles
End With
See Also