Sub PrintKoor()
Dim pMXD As IMxDocument
Dim pFeat As IFeature, pGeom As IGeometry, pp As IPoint
Dim pSelected As IEnumFeature
Set pMXD = ThisDocument
If pMXD.FocusMap.SelectionCount < 1 Then Exit Sub
Set pSelected = pMXD.FocusMap.FeatureSelection
pSelected.Reset
Set pFeat = pSelected.Next
Do While Not pFeat Is Nothing
Debug.Print "ObjectID="; pFeat.OID
PointsOfFeature pFeat
Debug.Print
Set pFeat = pSelected.Next
Loop
End Sub
Sub PointsOfFeature(pFeat As IFeature)
Dim pCol As IPointCollection
Dim pGeom As IGeometry
Dim pp As IPoint, i As Long
If Not pFeat.Shape Is Nothing Then
Set pGeom = pFeat.Shape
If pGeom.GeometryType = esriGeometryPoint Then
Set pCol = New Multipoint
Set pp = pFeat.Shape
pCol.AddPoint pp
Else
Set pCol = pFeat.Shape
End If
For i = 0 To pCol.PointCount - 1
Set pp = pCol.Point(i)
Debug.Print i + 1, pp.X, pp.Y
Next
End If
End Sub