<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to select multiple feature using VBA ? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109333#M2872</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the help. But I am creating a tool which can select multiple features eg. point features on a layer. I cannot use a query method. Please help.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A feature should have a key.&amp;nbsp; So, if you have a key then you select using that key:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// filterClause is: "Key = &amp;lt;keyvalue&amp;gt;" or "Key in (&amp;lt;keyvaluelist&amp;gt;)"
// esriSelectionResultEnum lets you add or subtract from the current select (or create a new selection)
public static void SelectBy(IActiveView view, ILayer2 targetLayer, string filterClause, esriSelectionResultEnum selectionResult)
{
 IFeatureSelection featureSelection = targetLayer as IFeatureSelection;
 if (featureSelection == null) return;
 IQueryFilter queryFilter = new QueryFilterClass();
 queryFilter.WhereClause = filterClause;
 IColor selectColor = Local.ColorToIColor(System.Drawing.Color.OrangeRed);
 ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass();
 fillSymbol.Color = selectColor;
 ISimpleLineSymbol outlineSymbol = new SimpleLineSymbolClass();
 outlineSymbol.Color = selectColor;
 outlineSymbol.Width = 2;
 fillSymbol.Outline = outlineSymbol;
 fillSymbol.Style = esriSimpleFillStyle.esriSFSHollow;
 featureSelection.SelectionSymbol = fillSymbol as ISymbol;
 featureSelection.SetSelectionSymbol = true;
 featureSelection.SelectFeatures(queryFilter, selectionResult, false);
 view.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, view.FocusMap, null);
}
&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you do not have a key and want to select by area then this selects from around a point:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// SelectByShape() will take any geometry (cricle, as here, or square, or rectangle)&amp;nbsp; 
public static IGeometry SelectFrom(IActiveView view, string limitToLayerName, IPoint point, float distance)
{
 if (!string.IsNullOrEmpty(limitToLayerName)) view.SetLayerSelectable(limitToLayerName);
 ISelectionEnvironment selectionEnvironment = null;
 IGeometry geometry = null;
 try
 {
&amp;nbsp; ICircularArc circularArc = new CircularArcClass();
&amp;nbsp; IConstructCircularArc constructCircularArc = circularArc as IConstructCircularArc;
&amp;nbsp; UnitConverter unitConverter = new UnitConverterClass();
&amp;nbsp; double radius = unitConverter.ConvertUnits(
&amp;nbsp;&amp;nbsp; distance, esriUnits.esriFeet, view.FocusMap.DistanceUnits);
&amp;nbsp; constructCircularArc.ConstructCircle(point, radius, false);
&amp;nbsp; RingClass ring = new RingClass();
&amp;nbsp; object missing = Type.Missing;
&amp;nbsp; ring.AddSegment(circularArc as ISegment, ref missing, ref missing);
&amp;nbsp; IPolygon polygon = new PolygonClass();
&amp;nbsp; IGeometryCollection geometryCollection = polygon as IGeometryCollection;
&amp;nbsp; geometryCollection.AddGeometry(ring, ref missing, ref missing);
&amp;nbsp; geometry = polygon;
&amp;nbsp; selectionEnvironment = new SelectionEnvironmentClass();
&amp;nbsp; selectionEnvironment.CombinationMethod = esriSelectionResultEnum.esriSelectionResultNew;
&amp;nbsp; IColor selectColor = selectionEnvironment.DefaultColor;
&amp;nbsp; selectColor = Local.ColorToIColor(System.Drawing.Color.OrangeRed);
&amp;nbsp; selectionEnvironment.DefaultColor = selectColor;
&amp;nbsp; view.FocusMap.SelectByShape(geometry, selectionEnvironment, false);
&amp;nbsp; view.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, view.Extent);
 }
 finally
 {
&amp;nbsp; Marshal.FinalReleaseComObject(selectionEnvironment);
 }
 return geometry;
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are just clicking on features then get the key from the point and pass a filterClause containing the key to the SelectBy():&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public static int GetTargetKeyByPoint(IMapControl4 mapControl, ILayer2 targetLayer, string keyName, IPoint point)
{
 int targetKey = 0;
 if (targetLayer == null) return targetKey;
 ILayerFields parcelFields = targetLayer as ILayerFields;
 if (parcelFields == null) return targetKey;
 int keyIndex = parcelFields.FindField(keyName);
 if (keyIndex == -1) return targetKey;
 IIdentify identify = targetLayer as IIdentify;
 IArray array = identify.Identify(point);
 if (array != null &amp;amp;&amp;amp; array.Count &amp;gt; 0)
 {
&amp;nbsp; IFeatureIdentifyObj featureIdentifyObj = array.get_Element(0) as IFeatureIdentifyObj;
&amp;nbsp; IRowIdentifyObject rowIdentifyObject = featureIdentifyObj as IRowIdentifyObject;
&amp;nbsp; IRow row = rowIdentifyObject.Row;
&amp;nbsp; if (row != null)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; IFeature feature = row as IFeature;
&amp;nbsp;&amp;nbsp; if (feature != null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; object value = feature.get_Value(keyIndex);
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (value != null)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; targetKey = int.Parse(value.ToString());
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
 }
 return targetKey;
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 06:34:28 GMT</pubDate>
    <dc:creator>GeorgeFaraj</dc:creator>
    <dc:date>2021-12-11T06:34:28Z</dc:date>
    <item>
      <title>How to select multiple feature using VBA ?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109329#M2868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am a little new to this but I wanted to know how do I select multiple features in a layer using VBA? I would appretiate if I could get some code. for eg selecting two or more point features. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Stuti Chandel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 05:18:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109329#M2868</guid>
      <dc:creator>StutiChandel</dc:creator>
      <dc:date>2012-02-07T05:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple feature using VBA ?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109330#M2869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The following code(from ESRI samples) selects features based on a query (NAME = 'Nova Scotia'). From the first layer added in the table of contents. Hope this is what you wanted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub SelectMapFeatures()
&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp; Dim pMap As IMap
&amp;nbsp; Dim pActiveView As IActiveView
&amp;nbsp; Dim pFeatureLayer As IFeatureLayer
&amp;nbsp; Dim pFeatureSelection As IFeatureSelection
&amp;nbsp; Dim pQueryFilter As IQueryFilter
&amp;nbsp; 
&amp;nbsp; 
&amp;nbsp; Set pMxDoc = Application.Document
&amp;nbsp; Set pMap = pMxDoc.FocusMap
&amp;nbsp; Set pActiveView = pMap
&amp;nbsp; 
&amp;nbsp; 'For simplicity sake let's use the first layer in the map
&amp;nbsp; If Not TypeOf pMap.Layer(0) Is IFeatureLayer Then Exit Sub
&amp;nbsp; Set pFeatureLayer = pMap.Layer(0)
&amp;nbsp; Set pFeatureSelection = pFeatureLayer 'QI
&amp;nbsp; 
&amp;nbsp; 'Create the query filter
&amp;nbsp; Set pQueryFilter = New QueryFilter
&amp;nbsp; pQueryFilter.WhereClause = "NAME = 'Nova Scotia'"
&amp;nbsp; 
&amp;nbsp; 'Invalidate only the selection cache
&amp;nbsp; 'Flag the original selection
&amp;nbsp; pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
&amp;nbsp; 'Perform the selection
&amp;nbsp; pFeatureSelection.SelectFeatures pQueryFilter, esriSelectionResultNew, False
&amp;nbsp; 'Flag the new selection
&amp;nbsp; pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
&amp;nbsp; 
End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:34:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109330#M2869</guid>
      <dc:creator>VinayanMP</dc:creator>
      <dc:date>2021-12-11T06:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple feature using VBA ?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109331#M2870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the help. But I am creating a tool which can select multiple features eg. point features on a layer. I cannot use a query method. Please help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 03:25:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109331#M2870</guid>
      <dc:creator>StutiChandel</dc:creator>
      <dc:date>2012-02-08T03:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple feature using VBA ?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109332#M2871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;is it that you want the functionality of "Select by location" tool in arcmap through VBA? In such case iSpatialFilter would help you..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 14:26:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109332#M2871</guid>
      <dc:creator>VinayanMP</dc:creator>
      <dc:date>2012-02-08T14:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple feature using VBA ?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109333#M2872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the help. But I am creating a tool which can select multiple features eg. point features on a layer. I cannot use a query method. Please help.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A feature should have a key.&amp;nbsp; So, if you have a key then you select using that key:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// filterClause is: "Key = &amp;lt;keyvalue&amp;gt;" or "Key in (&amp;lt;keyvaluelist&amp;gt;)"
// esriSelectionResultEnum lets you add or subtract from the current select (or create a new selection)
public static void SelectBy(IActiveView view, ILayer2 targetLayer, string filterClause, esriSelectionResultEnum selectionResult)
{
 IFeatureSelection featureSelection = targetLayer as IFeatureSelection;
 if (featureSelection == null) return;
 IQueryFilter queryFilter = new QueryFilterClass();
 queryFilter.WhereClause = filterClause;
 IColor selectColor = Local.ColorToIColor(System.Drawing.Color.OrangeRed);
 ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass();
 fillSymbol.Color = selectColor;
 ISimpleLineSymbol outlineSymbol = new SimpleLineSymbolClass();
 outlineSymbol.Color = selectColor;
 outlineSymbol.Width = 2;
 fillSymbol.Outline = outlineSymbol;
 fillSymbol.Style = esriSimpleFillStyle.esriSFSHollow;
 featureSelection.SelectionSymbol = fillSymbol as ISymbol;
 featureSelection.SetSelectionSymbol = true;
 featureSelection.SelectFeatures(queryFilter, selectionResult, false);
 view.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, view.FocusMap, null);
}
&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you do not have a key and want to select by area then this selects from around a point:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// SelectByShape() will take any geometry (cricle, as here, or square, or rectangle)&amp;nbsp; 
public static IGeometry SelectFrom(IActiveView view, string limitToLayerName, IPoint point, float distance)
{
 if (!string.IsNullOrEmpty(limitToLayerName)) view.SetLayerSelectable(limitToLayerName);
 ISelectionEnvironment selectionEnvironment = null;
 IGeometry geometry = null;
 try
 {
&amp;nbsp; ICircularArc circularArc = new CircularArcClass();
&amp;nbsp; IConstructCircularArc constructCircularArc = circularArc as IConstructCircularArc;
&amp;nbsp; UnitConverter unitConverter = new UnitConverterClass();
&amp;nbsp; double radius = unitConverter.ConvertUnits(
&amp;nbsp;&amp;nbsp; distance, esriUnits.esriFeet, view.FocusMap.DistanceUnits);
&amp;nbsp; constructCircularArc.ConstructCircle(point, radius, false);
&amp;nbsp; RingClass ring = new RingClass();
&amp;nbsp; object missing = Type.Missing;
&amp;nbsp; ring.AddSegment(circularArc as ISegment, ref missing, ref missing);
&amp;nbsp; IPolygon polygon = new PolygonClass();
&amp;nbsp; IGeometryCollection geometryCollection = polygon as IGeometryCollection;
&amp;nbsp; geometryCollection.AddGeometry(ring, ref missing, ref missing);
&amp;nbsp; geometry = polygon;
&amp;nbsp; selectionEnvironment = new SelectionEnvironmentClass();
&amp;nbsp; selectionEnvironment.CombinationMethod = esriSelectionResultEnum.esriSelectionResultNew;
&amp;nbsp; IColor selectColor = selectionEnvironment.DefaultColor;
&amp;nbsp; selectColor = Local.ColorToIColor(System.Drawing.Color.OrangeRed);
&amp;nbsp; selectionEnvironment.DefaultColor = selectColor;
&amp;nbsp; view.FocusMap.SelectByShape(geometry, selectionEnvironment, false);
&amp;nbsp; view.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, view.Extent);
 }
 finally
 {
&amp;nbsp; Marshal.FinalReleaseComObject(selectionEnvironment);
 }
 return geometry;
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are just clicking on features then get the key from the point and pass a filterClause containing the key to the SelectBy():&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public static int GetTargetKeyByPoint(IMapControl4 mapControl, ILayer2 targetLayer, string keyName, IPoint point)
{
 int targetKey = 0;
 if (targetLayer == null) return targetKey;
 ILayerFields parcelFields = targetLayer as ILayerFields;
 if (parcelFields == null) return targetKey;
 int keyIndex = parcelFields.FindField(keyName);
 if (keyIndex == -1) return targetKey;
 IIdentify identify = targetLayer as IIdentify;
 IArray array = identify.Identify(point);
 if (array != null &amp;amp;&amp;amp; array.Count &amp;gt; 0)
 {
&amp;nbsp; IFeatureIdentifyObj featureIdentifyObj = array.get_Element(0) as IFeatureIdentifyObj;
&amp;nbsp; IRowIdentifyObject rowIdentifyObject = featureIdentifyObj as IRowIdentifyObject;
&amp;nbsp; IRow row = rowIdentifyObject.Row;
&amp;nbsp; if (row != null)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; IFeature feature = row as IFeature;
&amp;nbsp;&amp;nbsp; if (feature != null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; object value = feature.get_Value(keyIndex);
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (value != null)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; targetKey = int.Parse(value.ToString());
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
 }
 return targetKey;
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:34:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109333#M2872</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2021-12-11T06:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple feature using VBA ?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109334#M2873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Both of these VBA samples will select multiple features in the map. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To perform a spatial&amp;nbsp; selection - "select within":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Sub SpatialSelection()
&amp;nbsp; Dim pMxApp As IMxApplication
&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp; Dim pMap As IMap
&amp;nbsp; Dim pTargetLayer As IFeatureLayer
&amp;nbsp; Dim pSelectingLayer As IFeatureLayer
&amp;nbsp; Dim pFeatureClass As IFeatureClass
&amp;nbsp; Dim pEnvelope As IEnvelope
&amp;nbsp; Dim pFeatureSelection As IFeatureSelection
&amp;nbsp; Dim pSpatialFilter As ISpatialFilter
&amp;nbsp; 
&amp;nbsp; Set pMxApp = Application
&amp;nbsp; Set pMxDoc = Application.Document
&amp;nbsp; Set pMap = pMxDoc.FocusMap

&amp;nbsp; Set pTargetLayer = pMap.Layer(0)
&amp;nbsp; Set pSelectingLayer = pMap.Layer(1)
&amp;nbsp; Set pFeatureClass = pTargetLayer.FeatureClass
&amp;nbsp; Set pEnvelope = pSelectingLayer.AreaOfInterest
&amp;nbsp; 
&amp;nbsp; Set pFeatureSelection = pTargetLayer
&amp;nbsp; Set pSpatialFilter = New SpatialFilter
&amp;nbsp; With pSpatialFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set .Geometry = pEnvelope
&amp;nbsp;&amp;nbsp;&amp;nbsp; .GeometryField = pFeatureClass.ShapeFieldName
&amp;nbsp;&amp;nbsp;&amp;nbsp; .SpatialRel = esriSpatialRelContains
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'add an optional .WhereClause
&amp;nbsp; End With
&amp;nbsp; 
&amp;nbsp; pFeatureSelection.SelectFeatures pSpatialFilter, esriSelectionResultNew, False
&amp;nbsp; pMxDoc.ActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To perform a selection of features within a graphic drawn in the map - this is MouseDown code for a UIToolControl, which will allow you to draw the graphic then selects the features within that graphic:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Private Sub UIToolControl1_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxApp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As IMxApplication
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDoc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As IMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pActiveView&amp;nbsp;&amp;nbsp; As IActiveView
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pRubberBand&amp;nbsp;&amp;nbsp; As IRubberBand
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSelectionSet As ISelectionSet
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureLayer As IFeatureLayer2
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureSelection As IFeatureSelection
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTargetLayer As IFeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pCircleArc As ICircularArc
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSegColl As ISegmentCollection
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFLayer As IFeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFc As IFeatureClass
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPoly As IPolygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxApp = Application
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxDoc = ThisDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMap = pMxDoc.FocusMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pActiveView = pMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTargetLayer = pMap.Layer(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pRubberBand = New RubberCircle
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pCircleArc = pRubberBand.TrackNew(pActiveView.ScreenDisplay, Nothing)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSegColl = New Polygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; pSegColl.SetCircle pCircleArc.CenterPoint, pCircleArc.Radius
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFLayer = pMap.Layer(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFc = pFLayer.FeatureClass
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pPoly = pSegColl
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSF As ISpatialFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSF = New SpatialFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; With pSF
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set .Geometry = pPoly
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GeometryField = pTargetLayer.FeatureClass.ShapeFieldName
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .SpatialRel = esriSpatialRelIntersects
&amp;nbsp;&amp;nbsp;&amp;nbsp; End With
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeatureSelection = pTargetLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatureSelection.SelectFeatures pSF, esriSelectionResultNew, False
&amp;nbsp;&amp;nbsp;&amp;nbsp; pMxDoc.ActiveView.Refresh

End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:34:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-select-multiple-feature-using-vba/m-p/109334#M2873</guid>
      <dc:creator>PhilMiotto</dc:creator>
      <dc:date>2021-12-11T06:34:31Z</dc:date>
    </item>
  </channel>
</rss>

