Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- multival = arcpy.GetParameterAsText(1) # 'Store_1;Store_2;Store_3'
- vals = multival.split(";")
- where_stub = """"NAME" IN ({})"""
- stores = ','.join(["'{}'".format(x) for x in vals])
- where = where_stub.format(stores)
- # Import arcpy module
- import arcpy
- from arcpy import env
- #workspace = GetParameterAsText (0) ???
- arcpy.CheckOutExtension("Network")
- # Local variables:
- in_network_dataset = "Transportation/Streets_ND"
- outNALayerName = "BestRoute"
- # Process: Make Route Layer
- arcpy.MakeRouteLayer_na(in_network_dataset, outNALayerName, "TravelTime",
- "FIND_BEST_ORDER", "PRESERVE_BOTH", "", "", "ALLOW_UTURNS",
- "Oneway;RestrictedTurns", "", "", "", "")
- # Process: Select
- Stores = "Stores.shp"
- Stores_Select = "Stores_Select_Output"
- Expression = arcpy.GetParameterAsText(0)
- vals = Expression.split(";")
- where_stub = """"NAME" IN ({})"""
- stores = ','.join(["'{}'".format(x) for x in vals])
- Expression = where_stub.format(stores)
- arcpy.Select_analysis(Stores, Stores_Select, Expression)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement