I've created a python script that manipulates a page layout so that I can export the view to a PDF. The code uses several different ""Select By Attribute" methods.
My code operates as a function in a module I import into the arcpy window. After executing the function a number of times (variable number - say between 5 and 20) the following error is returned
Attachment 22815
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000582: Error occurred during execution.
The code section that causes the error is:
Under geoprocessing options, I turned OFF background processing because simple selection like the one above take FOREVER with background processing turned on. (Side question - why must the map refresh after every selection? Can I supress that??)
I noticed however that if I turn background processing ON, I can run my code again without a problem. Does anyone have an idea what is causing this problem, and why it might be so seemingly random?
My code operates as a function in a module I import into the arcpy window. After executing the function a number of times (variable number - say between 5 and 20) the following error is returned
Attachment 22815
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000582: Error occurred during execution.
The code section that causes the error is:
Code:
##Highlight correct SU in extent window
df = arcpy.mapping.ListDataFrames(mxd, "Legend and Extent Rectangle")[0]
for lyr in arcpy.mapping.ListLayers(mxd, bldg, df):
for sublyr in lyr:
if sublyr.name == s:
sublyr.visible = True
arcpy.SelectLayerByAttribute_management(sublyr, "NEW_SELECTION", "[SU] = %d" % (SU))
else:
sublyr.visible = False
I noticed however that if I turn background processing ON, I can run my code again without a problem. Does anyone have an idea what is causing this problem, and why it might be so seemingly random?