Tag Archives: user

Getting a user’s selected feature in ArcGIS VBA/VB.NET

Dim pFL2 As IFeatureLayer
Set pFL2 = pMap.Layer(0)

Set pF2 As IFeature

Dim pfs As IFeatureSelection
Set pfs = pFL2
Dim id As Long
id = pfs.SelectionSet.IDs.Next
Set pF2 = pFL2.FeatureClass.GetFeature(id) ‘ this is line 2

Then you can do stuff on the Ifeature pF2 and pf2.Shape