2

I am trying to build a model that clips a bunch of my rasters to a specific polygon shape, and I need all my files to be labelled in a specific way. In order to label them, I am trying to use the create a variable tool to splice out the parts of the files paths I need and then use them to label the file.

It works fine without the spliced variables, for example when the Extract by Mask output is: %Name%_clipped, it is totally fine.

But when I try and add the Calculated Values as parameters to the name of the Extract by mask the model just iterates through the one variable set, rewriting over the file every time. It no longer iterates through the files in the geodatabase.

The Calculated Values are strings and the inputs look like: "%Name%"[0:5]

Any suggestions to get it to iterate though all the rasters in my geodatabase and name the files based on the input rasters?

The Model

1 Answer 1

2

When you change anything in your model with iterator, make sure you validate the model with those changes. Basically the gray shadow behind the Calculate_Value boxes indicates that they are ran (successfully) and the values are assigned. This is funny, because you expect that all items will rerun with the recent changes but if you do not (re-)validate your model, the gray shadow-ed boxes will not calculate and give you their old values. If you do not want to re-valuate each time, you can set iterator output (e.g., Output in your snip) as the preconditions to your Calculate_Value tools.

0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.