AnsweredAssumed Answered

inconsistent Arcpy.Mapping behaviour

Question asked by jhchan69 on Jul 31, 2014
Latest reply on Aug 21, 2014 by jhchan69

I've written a script using Arcpy.mapping module to automate map making. It works as a one-off for use in ArcMap if I use the ArcToolbox to call the script. But if I call it from python (eclipse) I get weird error messages ("ExecuteError: ERROR 000358: Invalid expression") pointing towards the "Select by Layer" tool. But it executes fine if run from ArcToolbox, no errors... same script.

 

Part 2: I gave up running it from Eclipse and ran it from ArcToolbox within ArcMap. Now I'm trying to run a batch - multiple maps. It used to work until this morning. this morning I made the most minor of changes... to check to see if a variable.upper() == 'YES'

again, this works in the "one-off" scenario within ArcMap called from ArcToolbox. But I'm trying to run my batch script (also called by ArcToolbox) and I get that same query error as above. Why is that? it's the exact same script. I don't want to interactively run this script in ArcMap for all 350+ maps. Why is arcpy.mapping so flaky? Is there a way to fix this???

Outcomes