Hi,
Can anyone assist with adding the Start and End co-ordinates to a polyline shp file in ArcPad?
I have the fields StartX, Start Y, EndX and EndY
I think the following script will come close- modified from a previous script, but I wasn't sure of the command for generating the start and end of polylines (as opposed to points)
Any help greatly appreciated
Bruce
Sub FeatAdded
Dim MyCoordSys, objRS, f, strMessage, fCount
Set MyCoordSys = Application.Map.CoordinateSystem
Set objRS = Map.Selectionlayer.Records
objRS.Bookmark = ThisEvent.Bookmark
If Right(objRS.Fields.ShapeType, 1) = 1 Then
If MyCoordSys.GeographicName = "GCS_WGS_1984" Then
For Each f in objRS.Fields
Select Case Ucase(f.name)
Case "StartX"
f.Value = objRS.Fields.Shape.Y
fCount = fCount + 1
Case "StartY"
f.Value = objRS.Fields.Shape.X
fCount = fCount + 1
Case "EndX"
f.Value = objRS.Fields.Shape.Y
fCount = fCount + 1
Case "EndY"
f.Value = objRS.Fields.Shape.X
fCount = fCount + 1
End Select
Next
Else
For Each f in objRS.Fields
Select Case Ucase(f.name)
Case "StartX"
f.Value = objRS.Fields.Shape.X
fCount = fCount + 1
Case "StartY"
f.Value = objRS.Fields.Shape.Y
fCount = fCount + 1
Case "EndX"
f.Value = objRS.Fields.Shape.X
fCount = fCount + 1
Case "EndY"
f.Value = objRS.Fields.Shape.Y
fCount = fCount + 1
End Select
Next
End If
End Sub</SCRIPT>
</ArcPad>