2

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

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jul 26, 2016 at 10:22
8
  • Put error along with, try name started with string not number e.g.test%n% instead of 335_%n% Commented Jul 26, 2016 at 10:33
  • The %% in model builder is used to refer to within-model variables, such as Name. In your case there is no n variable, therefore model builder won't get any value if %n% is used. Frankly, I'm not sure what you were trying to achieve with n. Commented Jul 26, 2016 at 10:35
  • @Lion I'm sorry, but it is still quite unclear to me. What were you trying to achieve? What do you mean by "Name is too long as a results" and what are you looking for instead? Commented Jul 26, 2016 at 11:43
  • @SIslam, you are right! It works! If you put your comment as answer, I can sign it as the right answer and close this question Commented Jul 26, 2016 at 11:58
  • @dof1985 thank you for your helping but I solved. I just wanted to have the possibility to change the name of every single output raster of slope with a new name and not using %Name% because the result was a long file name. Commented Jul 26, 2016 at 12:05

1 Answer 1

2

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%

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered Jul 27, 2016 at 4:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.