I have a simple tool which outputs a file. I would like the filename to be a number which increments every time the tool is run.
How would I go about implementing this using the toolbox in ArcMap 10?
Assuming your tool is always outputting the output file in the same directory, this function will return the next highest-numbered file name:
To get the next output file's path, simply print the function:
You could use this in your tool's ToolValidator class to generate this as default "output file" value, or you could include it in the tool's code itself, if you want the tool to simply accept an output folder for the generated file.