The script below works fine and produces the correct output, but after my output is being added to ArcMap, which is what I want it to do, it then disappears as the script is finishing up. I'd like for my data to stay visible on the map once the script is finished and not disappear.
Here is what's happening:
- Buffer output "TestFC_buf" gets added to the map.
- "Script Finished." and "Completed script TestAddToMap..." prints to the script dialog window.
- "TestFC_buf" disappears from the map.
- "Succeeded at Thu Aug 06..." prints to the script dialog window.
Here is the script dialog:
And here is the code:
import arcpy, os arcpy.env.overwriteOutput = True arcpy.env.addOutputsToMap = True arcpy.env.workspace = r"C:\Users\kgrady\Desktop\Temp\AddOutputToMap_Test\Test.gdb" workspace = arcpy.env.workspace fc = "TestFC" output = os.path.join(workspace, "TestFC_buf") arcpy.Buffer_analysis(fc, output, "1 Mile") arcpy.AddMessage("Script Finished.")
Any ideas as to why the output is disappearing from the map?