for BC Gov workers, I'm turning my MapRobot into a script that can do the same with a batch of files: ie. automate maps of different land tenures without having to open up ArcMap.
But I kept getting inexplicable errors about "IndexError: list index out of range"
The script works when called from ArcToolbox but not from another script.
What I thought the problem was:
My original map robot takes 5 arguments. But for my mapping batch I only care about one of them. I went thru the script and changed everything I could find so that it is disabled. The main part is the definition query that filters the layer, the calling of an inset map, and the calling of calculating dimensions. The dimensions are still needed, the inset map is no longer required and I only want to use file number for the definition query.
But making those changes didn't work.
So today I tried disabling all the other arguments and just use one, the file number. I went thru and tried to either disable or to ensure that the functions that use those arguments don't get used.
Now my program only requires one argument but it still gives me the same IndexError message.
My work folder is here:
\\spatialfiles.bcgov\work\srm\sry\Local\projlib\2014-15\Auth_Lands_PMV\data\scripts
the latest script (with only one argument) is map_robot_2014_v2_4batch.py
v2 was the one I gave up on because I couldn't figure it out
v1 works when called from arctoolbox.
if anyone can give me a hand it would be much appreciated!!!