Hi Ryan,
Thanks for the explanation, but I still don't subscribe to this point of view...
In my stubborn intent to combine the Hillshade command with the save command, something unexpected happened. For the record; I didn�??t have my hopes up high, but wanted to know how ArcMap would respond.
I loaded a DEM called myDEM to ArcMap, created a new file geodatabase and set it as my default geodatabase. After activating the Spatial Analyst extension, I opened the Python window and started with the line:
from arcpy.sa import *
My Hillshade command would be as simple as:
myHS = Hillshade("myDEM",315,45)
To force the temporary raster to be saved as �??myHS�?�, I started to type �??save(�?� at the end of the command. The moment the left bracket is typed, the command is executed. Every time you type another character the command is invoked again and again. In some cases an error about the background geoprocessing was thrown, and in another case ArcMap threw an error and closed�?�
Now, the nice thing is, that if you type the command in (say Notepad) and copy and paste it in the python window, the command is executed correctly and stores the raster with the given name:
myHS = Hillshade("myDEM",315,45).save("myHS")
The only strange behavior is that the resulting raster is not added to the TOC (although this is indicated in the Geoprocessing options)
OK, so I shouldn't do this, but is this the way ArcMap should react to such a situation?
In the old days when I used to work with ILWIS, they implemented two types of command lines.
Output = command
and
Output := command
The first resulting in a virtual object which would be (re)calculated in the moment it was requested and would change if the input data would change and the latter creating the physical output raster with the name provided.
I wonder if it would be possible to implement something like that (meaning := creates the raster with the name indicated, using only the = sign results in a temporary dataset) .
Why is there a difference between arcpy commands and arcpy.sa commands? If I use the arcpy.Clip_management command I don�??t use an output = command construction, but I am able to define the output name:
arcpy.Clip_management("myDEM","1952602 294196 1953546 296176","myClip", "#", "#", "NONE")
In the command above I am able to define the output name of the raster (it will be saved as "myClip")�?�
Kind regards,