Все просто .. но ничего не работает
Помогите плиз....запутался совсем..может кто носом ткнет...
pFeature.Value(I)) - вот эта строка возвращает правильное значение поля только, если покрытие загружено из MDB .... а если загружен просто Shapefile то значение пустое....
Помогите плиз....запутался совсем..может кто носом ткнет...
Private Sub SelectByLocate_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
Dim pMxApp As IMxApplication
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pActiveView As IActiveView
Dim pEnvelope As IEnvelope
Set pMxApp = Application
Set pMxDoc = Application.Document
Set pMap = pMxDoc.FocusMap
Set pActiveView = pMap
Set pEnvelope = pMxDoc.CurrentLocation.Envelope
pEnvelope.Expand pMxDoc.SearchTolerance, pMxDoc.SearchTolerance, False
'Refresh the old selection to erase it
pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
'Perform the selection using a point created on mouse down
pMap.SelectByShape pEnvelope, pMxApp.SelectionEnvironment, False
'Refresh again to draw the new selection
pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
Dim pEnumFeat As IEnumFeature
Dim pFeature As IFeature
Dim pFeatureClass As IFeatureClass
Dim pArea As IArea
Dim lLoop As Long
Dim I As Integer
Dim IdStr As String
saObjects = ""
Set pEnumFeat = pMxDoc.FocusMap.FeatureSelection
pEnumFeat.Reset
Set pFeature = pEnumFeat.Next
' If we pass the last feature, reset to the first
Do While Not pFeature Is Nothing
I = pFeature.Fields.FindField("ID_OB")
IdStr = CStr(pFeature.Value(I))
saObjects = saObjects & IdStr & "," & pFeature.Class.AliasName & "," & "TEST" & "#"
Set pFeature = pEnumFeat.Next
Loop
MsgBox saObjects
End Sub