env.workspace = arcpy.GetParameterAsText(0) ... YmapFile = arcpy.GetParameterAsText(4) # Output filename ... YMAP = arcpy.NumPyArrayToRaster(YmapArray,lowerLeft,pixSize,pixSize) YMAP.save(YmapFile) ... mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] arcpy.MakeRasterLayer_management(YmapFile,"Y Map") arcpy.mapping.AddLayer(df,"Y Map", "BOTTOM")
Solved! Go to Solution.
env.workspace = arcpy.GetParameterAsText(0)
...
YmapFile = arcpy.GetParameterAsText(4) # Output filename
...
YMAP = arcpy.NumPyArrayToRaster(YmapArray,lowerLeft,pixSize,pixSize)
YMAP.save(YmapFile)
...
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
arcpy.MakeRasterLayer_management(YmapFile,"Y Map")
ymapLyr = arcpy.mapping.Layer(r"c:/tmp/YMAP.lyr")
arcpy.mapping.AddLayer(df, ymapLyr,"BOTTOM")