Hi Amy,I looked into updating the polylines using python, but this may not be possible. A polyline object's properties are all read-only. Therefore I could not find a way to write new coordinate values to the end points of the mains.Something you can do to possibly help you is to write some code to obtain the OBJECTIDs of the mains that need to be moved. This will provide you a list with the feature's end points that are not snapped to a manhole. Ex:import arcpy
from arcpy import env
env.overwriteOutput = True
env.workspace = r"C:\Temp\Python\test.gdb"
fc = "swManhole"
fc2 = "swGravityMain"
pnt = arcpy.Point()
# Move Manholes to GPS location
rows = arcpy.UpdateCursor(fc)
for row in rows:
pnt.X = row.POINT_X
pnt.Y = row.POINT_Y
row.shape = pnt
rows.updateRow(row)
del row, rows
# Convert Main endpoints to points feature class
arcpy.FeatureVerticesToPoints_management(fc2, "Main_EndPts", "END")
# Find all Main endpoints within 5 feet of manholes
arcpy.Near_analysis("Main_EndPts", fc, "5")
# Create a layer of all Main endpoints within 5 feet of manholes
lyr = arcpy.MakeFeatureLayer_management("Main_EndPts", "Main_EndPts_Lyr", "NEAR_DIST > 0")
list = []
# Append X & Y values of Main endpoints to list
rows = arcpy.SearchCursor(lyr)
for row in rows:
list.append(float(row.shape.centroid.X) + float(row.shape.centroid.Y))
del row, rows
OBJECTIDs = []
# Find OBJECTIDs of the Mains that need to be moved
rows = arcpy.SearchCursor(fc2)
for row in rows:
geom = row.shape
XY = float(geom.lastPoint.X) + float(geom.lastPoint.Y)
if XY in list:
OBJECTIDs.append(row.OBJECTID)
del row, rows
arcpy.Delete_management("Main_EndPts")
print OBJECTIDs