0

i have made a python toolbox (.pyt file) and run it in Arcgis 10.1. The Output is a raster and I want it to automatically show up in the Arcmap viewer. The option for displaying the output of geoprocessing under Geoprocessing Options is turned on, but the raster layer still does not show up. Of course I can add it the usual way but normally when running a toolbox, the results show up without doing anything. I also tried this: arcpy.env.addOutputsToMap = True but there´s no effect out of it.

Can somebody help me?

1 Answer 1

2

You will need to create a layer from your output and add it to the TOC like this:

# Add Outputs to Display
#
arcpy.mapping.AddLayer(df, newlayerA,"TOP")
arcpy.mapping.AddLayer(df, newlayerB,"BOTTOM")

Also you may need to refresh the active view or TOC like this:

# Refresh things
#
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.