I'm using ArcPy for a vehicle routing problem in ArcGIS Desktop. I'm using the Network Analyst tool to find the minimum number of routes needed to service all orders given some constraints. I can create and solve the routing problem in AcrPy, but I can't figure out how to return the number of unassigned orders.
Some things I've tried:
temp = arcpy.na.Solve("Vehicle Routing Problem") solution = temp.getOutput(0) ###Now check what it can do### dir(solution)
'Solution' is a group layer. I had expected to see information about the routes, orders, etc. - but couldn't find any of it.
Then I thought that the information could be present in a different layer, so I checked a list of layers, but didn't find anything interesting:
document = arcpy.mapping.MapDocument("CURRENT") arcpy.mapping.ListLayers(document)
This matched by Table of Contents, but not the contents of the Network Analyst window (which is what I really wanted).
Eventually I gave up op on the idea that the information I wanted was attached to a layer. I found this article on the ESRI website which references an "UnassignedOrders" table, but I have no idea how to access that.