2

How can I automatically rename all new datasets/layers (ModelBuilder outputs) in ModelBuilder using ArcGIS Desktop based on one predefined new name or, alternatively, based on the name of the first data set that the model uses?

I am asking as I keep having to rename everything when I run the model multiple times.

  • 2
    Can you edit your question to show an image of the model you're currently using? Usually the answer is using one of the values in the model in the output name, for example %Name%. – lambertj Dec 17 '18 at 16:49
  • I don't have access to it now but I mean in general. Let's say you import a text file with coordinates and some other meta data that you want plotted etc. Within each tool you have to specify a name but I want it to be dynamic so that other people can use it without any issues. I suppose the also raises the question about predefined locations for storing the data produced in the model. Is it possible to just define where to save everything when first launching the model? – MSS Dec 17 '18 at 17:14
  • Is the example model in the answer below the type of thing you were looking for? I can edit the answer if this isn't what you meant. – lambertj Dec 18 '18 at 15:45
1

Set both the input tabular dataset and the output location as model parameters to define those values when the model first launches. When the user runs the model, they will be prompted for these inputs. Stilwell II PP.csv and Stilwell are the input tabular data and output directory in the example below. Note the P above those parts of the model showing these are Model Parameters.

You can also use the Parse Path tool to extract the name of the input table and use that to dynamically update the name of any outputs from the model (see first image).

For example, the model shown below should be pretty close to what you need. In that example, %Value% comes from the Parse Path tool (specifically the Name parameter), and is used as part of the name for each successive output. enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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