arcpy.SetParameterAsText(2, i[4])should assign i[4] as the third parameter, correct? I have assigned the third parameter as a derived output. The following is the script for the model's rename portion, and attached is a graphic of the model. Any help would be greatly appreciated.
import datetime,csv,sys,os,arcpy from datetime import date todays_date = datetime.date.today() todays_date = todays_date.strftime("%Y %m %d") todays_date = todays_date.split() todays_date = map(int, todays_date) todays_date = date(todays_date[0], todays_date[1], todays_date[2]) calendar = csv.reader(open(sys.argv[1])) calendar.next() calendar.next() calendar.next() l = reversed(list(calendar)) for i in l: try: file_date = i[0].split('/') file_date = '20' + file_date[2] + ' ' + file_date[0] + ' ' + file_date[1] file_date = file_date.split() file_date = tuple(map(int, file_date)) file_date = date(file_date[0], file_date[1], file_date[2]) if todays_date >= file_date: current_file = i[4] + '.ides.csv' arcpy.SetParameterAsText(2, i[4]) break except IndexError: pass rename_file = os.listdir('W:\WDIA_Production\Geocoding_Files')[0] os.rename(os.path.join(sys.argv[2], rename_file),os.path.join(sys.argv[2],current_file))
Solved! Go to Solution.
import arcpy arcpy.ImportToolbox(r"W:\WDIA_Production\Toolbox.tbx", "TBX") arcpy.ClaimantAddressGeocoding_TBX(variable)
arcpy.AddMessage("returning {0}".format(repr(i[4])) arcpy.SetParameterAsText(2, i[4])
rename_file = os.listdir(r'W:\WDIA_Production\Geocoding_Files')[0]
import arcpy arcpy.ImportToolbox(r"W:\WDIA_Production\Toolbox.tbx", "TBX") arcpy.ClaimantAddressGeocoding_TBX(variable)