This document is archived and information here might be outdated.  Recommended version.

IConnectedCells.LocateByArea Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > ArcScan > ESRI.ArcGIS.ArcScan > Interfaces > IC > IConnectedCells Interface > IConnectedCells.LocateByArea Method
ArcGIS Developer Help

IConnectedCells.LocateByArea Method

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 _
public void LocateByArea (
    int Area,
    bool lessThan,
    bool equalTo,
    bool Foreground,
    IGeometry bounds,
    INotifySelectionBlock callbackSel,
    ITrackCancel trackCancel,
    IStepProgressor stepProgressor

Product Availability

Available with ArcGIS Desktop. Requires ArcScan Extension.


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");


See Also

IConnectedCells Interface