Just started using arcpy on ArcMap 10.2.2
Some modules - eg Hillshade - do not accept output raster names as parameters. I want to be able to specify the name of the output raster that appears in the ArcMap session's Table of Contents AND the geodatabase I'm currently working in. At the moment I'm using this method:
> # Some environment settings:
> import arcpy
> from arcpy import env
> from arcpy.sa import *
> # set geodatabase
> env.workspace = "path\to\my\Scratch.gdb"
> # Prevent output adding to the map
> env.addOutputsToMap="FALSE"
ESRI Help http://resources.arcgis.com/en/help/main/10.1/index.html#//009z000000v0000000 suggests setting the out_raster as a variable then saving output to workspace...
> myRaster== HillShade(inRaster, azimuth, altitude, modelShadows, zFactor)
> myRaster.save("path/to/my/place")
BUT the name myRaster is not applied to the file saved in the geodatabase. Instead it is the 'auto generated' raster name applied by ArcMap. If env.addOutputsToMap="TRUE" then the raster name is set to myRaster and added to the map but in the gbd is the auto name.
I find it hard to believe there is no functionality to do what I'm trying to do.
thanks