This document is archived and information here might be outdated. Recommended version. |
Generates the envelopes that represent all connected cells that meet the area criteria.
[Visual Basic .NET] Public Sub LocateByArea ( _ ByVal Area As Integer, _ ByVal lessThan As Boolean, _ ByVal equalTo As Boolean, _ ByVal Foreground As Boolean, _ ByVal bounds As IGeometry, _ ByVal callbackSel As INotifySelectionBlock, _ ByVal trackCancel As ITrackCancel, _ ByVal stepProgressor As IStepProgressor _ )
[C#] public void LocateByArea ( int Area, bool lessThan, bool equalTo, bool Foreground, IGeometry bounds, INotifySelectionBlock callbackSel, ITrackCancel trackCancel, IStepProgressor stepProgressor );
This method is called by the Select Connected Cells dialog.
The following code shows an example of this method in C#.
//You can get app from ICommand :: OnCreate() hook parameter
public void LocateByArea()
{
IConnectedCells connectedCells=app.FindExtensionByName("ESRI ArcScan Tools") as IConnectedCells;
IMxDocument mxDoc=app.Document as IMxDocument;
INotifySelectionBlock foundBlock=new FoundBlock();
connectedCells.LocateByArea(1000, true, true, true, mxDoc.ActiveView.Extent, foundBlock, null, null);
}
Also create a new class (FoundBlock) with the following code.
public class FoundBlock : ESRI.ArcGIS.ArcScan.INotifySelectionBlock
{
public FoundBlock()
{
}
#region INotifySelectionBlock Members
void ESRI.ArcGIS.ArcScan.INotifySelectionBlock.SelectionBlock(ref ESRI.ArcGIS.Display.tagRECT rectangle, object block, ESRI.ArcGIS.esriSystem.ITrackCancel cancel)
{
System.Diagnostics.Debug.Print("Found block");
}
#endregion
}