HOW TO
The script in this article demonstrates one way to return the end point of a polyline and draw a graphic point at this location. You can modify this script to meet your needs.
Code:
aView = av.GetActiveDoc
aTheme = aView.GetThemes.Get(0)
aFtab = aTheme.GetFtab
aShapeField = aFtab.FindField("Shape")
for each rec in aFtab.GetSelection
aPolyLine = aFtab.ReturnValue(aShapeField, rec)
'-- The following line will return a list containing lists of Points
aPTList = aPolyLine.asList
'-- Get the list of points from the list containing lists of Points
aPTList2 = aPTList.Get(0)
'-- Get the last point in the list of Points,
'-- which should be the end Point of the Polyline
aPT = aPTList2.Get(aPTList2.Count -1)
'-- To return the starting point of the PolyLine, uncomment the
'-- following line and comment out the previous line
'aPT = aPTList2.Get(0)
'-- Create a graphic of the End Point
aGraphicShape = GraphicShape.Make(aPT)
aView.GetGraphics.Add(aGraphicShape)
end
aView.Invalidate
Article ID:000004036
Get help from ArcGIS experts
Download the Esri Support App