Hi Melinda,
Sorry for this heavy replying. I did more change to the script and the measureOnLine finally works. Here's the script:
>>> import arcpy
# import stop feature class and create geometry objects
>>> fcStop = 'C:/shapefile/bus_stops.shp'
>>> cursorStop = arcpy.da.SearchCursor(fcStop,['STOP_ID','SHAPE@'])
>>> stopGeom = cursorStop.next()
>>> stopGeom = stopGeom[0]
# import route feature class and create geometry objects
>>> fcRoute = 'C:/shapefile/routes.shp'
>>> cursorRoute = arcpy.da.SearchCursor(fcRoute,['SHAPE@'])
>>> routeGeom = cursorRoute.next()
>>> routeGeom = routeGeom[0]
#measure distance on route
>>> dist_along_route = routeGeom.measureOnLine(stopGeom,FALSE)
#print results
>>> print dist_along_route
The above script generates a value of 26983.41708113748.
I think it calculates the distance of the first stop to the first route. I checked the stop and the route, turned out the stop is not on the route. So two more questions:
1) How to interpret the meaning of this 'distance'? Is it euclidean distance?
2) For each route, how to calculate the distances of stops that only falls on this route? Should I generate separate point shpfiles for each route?
Again, sorry for all the troubles, and many thanks.
Sui