I have several DEMs where I want to calculate their slope degrees. I used iterate rasters with slope tool and I put %Name%_slope as Output Name. The problem is the Name: it creates a file name too long ("dtm000628_slope")... I would have slope rasters with name 335_%n%, but "%n%" doesn't work. Do you know how I could change the name in an rasters iterators?
Here the model **The solution is found:
In the output raster, %n% makes a sequential number in the file name of output rasters, but not if you start the file name with a number:
-Example 1:
in output raster = "C:\Output.gdb335円_slope%n%"
it will not work
-Example 2:
in output raster = "C:\Output.gdb\slope335_%n%"
it will work
-Example 3:
in output raster = "C:\Output.gdb\s335_%n%"
it will work
1 Answer 1
I think you are wrong with the naming convention of the arcgis featueclass, for details of naming convention get details at the Defining feature class properties of the Online Help.
According to these rules your featureclass name can not be started with numbers.
%n%
means the loop number in the arcgis model builder.
So your intended name must be like string+(number)+%n%
e.g. Test_%n%
Explore related questions
See similar questions with these tags.
test%n%
instead of335_%n%
%%
in model builder is used to refer to within-model variables, such asName
. In your case there is non
variable, therefore model builder won't get any value if%n%
is used. Frankly, I'm not sure what you were trying to achieve withn
.