All,
My python codes were generated from ModelBuilder. At the process of "Table To Excel" I need to have 2 parameters: File_Path and File_Name. So in "Properties" of Script, I add those 2 parameters but the parameter for File Path doesn't work. No error but file was saved to the "Scratch" folder. What step that I missed? Thanks for your help.
# Model Environment settings
with arcpy.EnvManager(scratchWorkspace=r"C:\ModelBuilder\Scratch\Output.gdb", workspace=r"C:\ModelBuilder\Scratch\Output.gdb"):
Output_gdb = "C:\\ModelBuilder\\Scratch\\Output.gdb"
# Process: Table To Excel (Table To Excel) (conversion)
arcpy.conversion.TableToExcel(Input_Table=Parcels_Lots_DeleteIdentical, Output_Excel_File=ExcelFileName_xls, Use_field_alias_as_column_header="ALIAS", Use_domain_and_subtype_description="DESCRIPTION")
if __name__ == '__main__':
SqftMapToExcelNewLoc(*argv[2:])
Solved! Go to Solution.
where is argv defined?
I guess I didn't have it defined. I'm not familiar with python so please excuse my stupid questions above. I'll try to see if I can define the argv. Thank you!