# Fun stuff start = datetime.datetime.strptime(start,"%m/%d/%Y") end = time.strftime(end,"%m/%d/%Y")
# Import arcpy module import arcpy, datetime # Script arguments input = arcpy.GetParameterAsText(0) # feature class with date data outfolder = arcpy.GetParameterAsText(1) # folder for your shapefiles start = arcpy.GetParameterAsText(2) # first date in date range end = arcpy.GetParameterAsText(3) # last date in date range # Fun stuff start = datetime.datetime.strptime(start,"%m/%d/%Y") end = datetime.datetime.strptime(end,"%m/%d/%Y") curdate = start while curdate < end: curdate = curdate + datetime.timedelta(days=1) where_clause = "\"Start_Date\" < date '" + curdate.strftime("%m/%d/%Y") + "' and \"End_Date\" > date '" + curdate.strftime("%m/%d/%Y") + "'" arcpy.AddMessage(where_clause) opfile = outfolder + "/" + curdate.strftime("%m%d%Y") + ".shp" arcpy.Select_analysis(input, opfile, where_clause)
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.