<?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: Help with ArcObjects for VBA Application in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/help-with-arcobjects-for-vba-application/m-p/468549#M12703</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK had a look at your code and you were getting the enumerate from the wrong layer. But I found reading your code a bit out of sync so whilst trying to understand I re-jigged and simplified so its easier. Also put some comments in!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had to fake some data to make it work (selected points selecting polygons) and I use different layer names and positions so this code does not replace your existing code. You need to look at this and see the key changes to understand where you were going wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Public Sub SelectSchoolDistrict()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxApp As IMxApplication &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDoc As IMxDocument &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pActiveView As IActiveView &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnumFeature As IEnumFeature &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeature As IFeature &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxApp = Application &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxDoc = Application.Document &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pActiveView = pMxDoc.FocusMap &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMap = pMxDoc.FocusMap &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get first layer and the selected ID's &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureCursor As IFeatureCursor &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureSelection As IFeatureSelection &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSelectionSet As ISelectionSet &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureLayer As IFeatureLayer &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeatureLayer = pMxDoc.FocusMap.Layer(0) ' A point layer &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeatureSelection = pFeatureLayer &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSelectionSet = pFeatureSelection.SelectionSet &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnumParcelIDs As IEnumIDs &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnumParcelIDs = pSelectionSet.IDs &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Load selected points into&amp;nbsp; geometry bag &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeoColl As IGeometryCollection &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGeoColl = New GeometryBag &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPoint As IPoint &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim id As Long &amp;nbsp;&amp;nbsp;&amp;nbsp; id = pEnumParcelIDs.Next &amp;nbsp;&amp;nbsp;&amp;nbsp; Do While id &amp;lt;&amp;gt; -1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature = pFeatureLayer.FeatureClass.GetFeature(id) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pPoint = pFeature.Shape &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGeoColl.AddGeometry pPoint &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id = pEnumParcelIDs.Next &amp;nbsp;&amp;nbsp;&amp;nbsp; Loop &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeom As IGeometry &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGeom = pGeoColl &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get layer &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pISDLayer As IFeatureLayer &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ISDcount As Integer &amp;nbsp;&amp;nbsp;&amp;nbsp; For ISDcount = 0 To pMap.LayerCount - 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pISDLayer = pMap.Layer(ISDcount) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If pISDLayer.Name = "Display Index" Then&amp;nbsp; ' A polygon layer &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit For &amp;nbsp;&amp;nbsp;&amp;nbsp; End If &amp;nbsp;&amp;nbsp;&amp;nbsp; Next &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pISDfSel As IFeatureSelection &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pISDfSel = pISDLayer&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Create spatial filter &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSpatialFilter As ISpatialFilter &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSpatialFilter = New SpatialFilter &amp;nbsp;&amp;nbsp;&amp;nbsp; With pSpatialFilter &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set .Geometry = pGeom &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GeometryField = "SHAPE" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .SpatialRel = esriSpatialRelWithin &amp;nbsp;&amp;nbsp;&amp;nbsp; End With &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Do selection and refresh map &amp;nbsp;&amp;nbsp;&amp;nbsp; pISDfSel.SelectFeatures pSpatialFilter, esriSelectionResultNew, False &amp;nbsp;&amp;nbsp;&amp;nbsp; pActiveView.Refresh End Sub&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Aug 2013 13:56:17 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2013-08-22T13:56:17Z</dc:date>
    <item>
      <title>Help with ArcObjects for VBA Application</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/help-with-arcobjects-for-vba-application/m-p/468548#M12702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have inherited a VBA application that we use to notify land owners of changes in zoning near their properties.&amp;nbsp; I did not write the original application and I have not done much programming in VBA.&amp;nbsp; I am currently working on replacing this application with a python add-in, but a change in state law is forcing me to update the VBA application because of time constraints.&amp;nbsp; The new state law requires that with any zoning cases municipalities must notify school districts of any changes in zoning that occur within the district boundaries.&amp;nbsp; I have create a polygon feature class of the school districts with the mailing addresses for each district.&amp;nbsp; Users can choose to select one or more parcels or zoning case polygons or choose to select a polygon shapefile to designate the area being rezoned.&amp;nbsp; The application then converts these polygons to a graphic element and then creates a graphical buffer around first graphic.&amp;nbsp; These graphics are then use select the parcels that intersect the combined graphics, select the corresponding records in a related tax roll table and export the results into a dbf file.&amp;nbsp; I want to use a spatial filter to select any school district polygons that intersect the shapefile polygons or the original selection before the graphics are created.&amp;nbsp; Then store the selected records in a global selectionset and insert the records into the final dbf.&amp;nbsp; I have tried to create a procedure to do this, but it keeps crashing on me.&amp;nbsp; Here is what I have so far: &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;Public Sub SelectSchoolDistrict()&amp;nbsp; Dim pMxApp As IMxApplication &amp;nbsp; Dim pMap As IMap &amp;nbsp; Dim pMxDoc As IMxDocument &amp;nbsp; Dim pActiveView As IActiveView &amp;nbsp; Dim pEnumFeature As IEnumFeature &amp;nbsp; Dim pFeature As IFeature &amp;nbsp; Set pMxApp = Application &amp;nbsp; Set pMxDoc = Application.Document &amp;nbsp; Set pActiveView = pMxDoc.FocusMap &amp;nbsp; Set pMap = pMxDoc.FocusMap &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; Dim pFeatureCursor As IFeatureCursor &amp;nbsp; Dim pFeatureSelection As IFeatureSelection &amp;nbsp; Dim pSelectionSet As ISelectionSet &amp;nbsp;&amp;nbsp; &amp;nbsp; Set pFeatureSelection = pMxDoc.FocusMap.Layer(1) 'FeatureSelection &amp;nbsp; Set pSelectionSet = pFeatureSelection.SelectionSet &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; m_SetSelectableLayer ("School District") &amp;nbsp;&amp;nbsp; &amp;nbsp; If ThisDocument.g_Model = 2 Then &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pISDLayer As IFeatureLayer &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSearchLayer As ILayer &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ISDcount As Integer &amp;nbsp;&amp;nbsp;&amp;nbsp; For ISDcount = 0 To pMxDoc.FocusMap.LayerCount - 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSearchLayer = pMxDoc.FocusMap.Layer(ISDcount) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If pSearchLayer.Name = "School Districts" Then &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pISDLayer = pSearchLayer &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit For &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If &amp;nbsp;&amp;nbsp;&amp;nbsp; Next &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pISDfSel As IFeatureSelection &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pISDfSel = pISDLayer &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnumParcelIDs As IEnumIDs &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnumParcelIDs = pSelectionSet.IDs &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeoCollParcel As IGeometryCollection &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGeoCollParcel = New GeometryBag &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim count As Long &amp;nbsp;&amp;nbsp;&amp;nbsp; For count = 1 To pSelectionSet.count &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGeoCollParcel.AddGeometry pISDLayer.FeatureClass.GetFeature(pEnumParcelIDs.Next).Shape &amp;nbsp;&amp;nbsp;&amp;nbsp; Next count &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pISDSpatialFilter As ISpatialFilter &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pISDSpatialFilter = New SpatialFilter &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; With pISDSpatialFilter &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set .Geometry = pGeoCollParcel &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GeometryField = "Shape" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .SpatialRel = esriSpatialRelContains &amp;nbsp;&amp;nbsp;&amp;nbsp; End With &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; pISDfSel.SelectFeatures pISDSpatialFilter, esriSelectionResultNew, False &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Set gISDSelectionSet = pISDfSel.SelectionSet &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; End If &amp;nbsp;&amp;nbsp; 'End Section to add ISD addresses &amp;nbsp;&amp;nbsp; End Sub&amp;nbsp; &lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate any help or advise that anyone can offer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 19:41:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/help-with-arcobjects-for-vba-application/m-p/468548#M12702</guid>
      <dc:creator>DavidDenham</dc:creator>
      <dc:date>2013-08-16T19:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with ArcObjects for VBA Application</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/help-with-arcobjects-for-vba-application/m-p/468549#M12703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK had a look at your code and you were getting the enumerate from the wrong layer. But I found reading your code a bit out of sync so whilst trying to understand I re-jigged and simplified so its easier. Also put some comments in!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had to fake some data to make it work (selected points selecting polygons) and I use different layer names and positions so this code does not replace your existing code. You need to look at this and see the key changes to understand where you were going wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Public Sub SelectSchoolDistrict()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxApp As IMxApplication &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDoc As IMxDocument &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pActiveView As IActiveView &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnumFeature As IEnumFeature &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeature As IFeature &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxApp = Application &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxDoc = Application.Document &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pActiveView = pMxDoc.FocusMap &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMap = pMxDoc.FocusMap &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get first layer and the selected ID's &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureCursor As IFeatureCursor &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureSelection As IFeatureSelection &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSelectionSet As ISelectionSet &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureLayer As IFeatureLayer &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeatureLayer = pMxDoc.FocusMap.Layer(0) ' A point layer &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeatureSelection = pFeatureLayer &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSelectionSet = pFeatureSelection.SelectionSet &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnumParcelIDs As IEnumIDs &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnumParcelIDs = pSelectionSet.IDs &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Load selected points into&amp;nbsp; geometry bag &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeoColl As IGeometryCollection &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGeoColl = New GeometryBag &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPoint As IPoint &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim id As Long &amp;nbsp;&amp;nbsp;&amp;nbsp; id = pEnumParcelIDs.Next &amp;nbsp;&amp;nbsp;&amp;nbsp; Do While id &amp;lt;&amp;gt; -1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature = pFeatureLayer.FeatureClass.GetFeature(id) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pPoint = pFeature.Shape &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGeoColl.AddGeometry pPoint &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id = pEnumParcelIDs.Next &amp;nbsp;&amp;nbsp;&amp;nbsp; Loop &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeom As IGeometry &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGeom = pGeoColl &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get layer &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pISDLayer As IFeatureLayer &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ISDcount As Integer &amp;nbsp;&amp;nbsp;&amp;nbsp; For ISDcount = 0 To pMap.LayerCount - 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pISDLayer = pMap.Layer(ISDcount) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If pISDLayer.Name = "Display Index" Then&amp;nbsp; ' A polygon layer &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit For &amp;nbsp;&amp;nbsp;&amp;nbsp; End If &amp;nbsp;&amp;nbsp;&amp;nbsp; Next &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pISDfSel As IFeatureSelection &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pISDfSel = pISDLayer&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Create spatial filter &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSpatialFilter As ISpatialFilter &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSpatialFilter = New SpatialFilter &amp;nbsp;&amp;nbsp;&amp;nbsp; With pSpatialFilter &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set .Geometry = pGeom &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GeometryField = "SHAPE" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .SpatialRel = esriSpatialRelWithin &amp;nbsp;&amp;nbsp;&amp;nbsp; End With &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Do selection and refresh map &amp;nbsp;&amp;nbsp;&amp;nbsp; pISDfSel.SelectFeatures pSpatialFilter, esriSelectionResultNew, False &amp;nbsp;&amp;nbsp;&amp;nbsp; pActiveView.Refresh End Sub&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 13:56:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/help-with-arcobjects-for-vba-application/m-p/468549#M12703</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2013-08-22T13:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with ArcObjects for VBA Application</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/help-with-arcobjects-for-vba-application/m-p/468550#M12704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That fixed it thanks for the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2013 19:11:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/help-with-arcobjects-for-vba-application/m-p/468550#M12704</guid>
      <dc:creator>DavidDenham</dc:creator>
      <dc:date>2013-09-20T19:11:20Z</dc:date>
    </item>
  </channel>
</rss>

