Customer Service | Training | Contact Us
You are here: Home > User Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects Visual Basic for Application (VBA) forum

Code to select all features in a layer   Andrew Jones Oct 07, 2004
Re: Code to select all features in a layer   Kirk Kuykendall Oct 07, 2004
Re: Code to select all features in a layer   Andrew Jones Oct 07, 2004
Re: Code to select all features in a layer   Kirk Kuykendall Oct 07, 2004
Report Inappropriate Content • Top • Print • Reply    
Subject Code to select all features in a layer 
Author Andrew Jones 
Date Oct 07, 2004 
Message How do I select all features in a layer using VBA. It is an option in the attributes table but I can't seem to find the solution.

Tar
Andy 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Code to select all features in a layer 
Author Kirk Kuykendall 
Date Oct 07, 2004 
Message see code below

kkeywords selectall 
 
Option Explicit
Sub Test()
    Dim pMxDoc As IMxDocument
    Set pMxDoc = ThisDocument
    SelectAll pMxDoc.FocusMap.Layer(0)
End Sub

Sub SelectAll(pFSel As IFeatureSelection)
    pFSel.SelectFeatures Nothing, esriSelectionResultNew, False
End Sub
 
  Kirk Kuykendall
AmberGIS Programming Services & Sales
web: http://www.ambergis.com
blog: http://ambergis.wordpress.com/
LinkedIn: http://www.linkedin.com/in/kirkkuykendall 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Code to select all features in a layer 
Author Andrew Jones 
Date Oct 07, 2004 
Message So if you use 'Nothing' as the QFilter in SelectFeatures it selects all? I thought there would be an easy way to do it. Thank you! 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Code to select all features in a layer 
Author Kirk Kuykendall 
Date Oct 07, 2004 
Message Yes, Nothing means Everything.

I guess its like SQL - if you omit the whereclause all rows are returned. 
  Kirk Kuykendall
AmberGIS Programming Services & Sales
web: http://www.ambergis.com
blog: http://ambergis.wordpress.com/
LinkedIn: http://www.linkedin.com/in/kirkkuykendall