ArcObjects – How to Get All Features in Current Extent in ArcGIS 10.0

arcgis-10.0arcgis-enginearcobjects

I like to add text information to each feature in the shown map extent in my MapControl/PageLayoutControl. Adding the text is not a problem, but I couldn't find a way on how to get the features.

Is there a way to get all features in a layer that are in the current map extent?

Best Answer

Have you looked at:

Dim pEnv As IEnvelope
 pEnv = pAv.ScreenDisplay.DisplayTransformation.VisibleBounds

Setting the envelope = to the activeview visible bounds. You will then have to define a spatial filter, find the specific feature class, and set that to a featurecursor to grab all the features.