2

I run ArcGIS Pro 2.0 on windows 10. '

I run a model where the last tool is 'Sort' and the output is a featureclass to a geodatabase.

In my models I use the iterator inline variable, %Name%, from feature class iterator.

It names the files, as seen in windows file explorer, correctly, like: SortedPollution- where Pollution is %Name%

In map view the files are displayed as the output of the model, like: Sorted%Name%.shp.

Odd error, I am sure it has a simple solution.

In the case on the attached image you can see it displays the properties of "Sorted%Name%" when it is pointing to the file named correctly as "Sorteddkjord_v2".

enter image description here

1

There is a subtle difference between a tools output model element name and what it contains. Your output of the sort tool would be:

c:\testmapper\rasteroutt\sorted%name%.shp

You have also named the element to sorted%name%.shp, this is what you visually see when you are in model builder. So you could have named the element "Mathias" but it contains c:\testmapper\rasteroutt\sorted%name%.shp.

When you add a layer to the map automatically it takes on the name of the element and not the featureclass name (which would not be appropriate). As the element name is unchanging this is why you have many layers with the same name but all pointing to different featureclasses.

So it's not really a bug it is expected behavior of model builder.

How to resolve this is with a bit of code. See example below. The output of Sort is something that should not exist in your map. I called it myOutput. This is a precondition to the model only Calculate Value tool.

Model

The calculate tool is set up as below:

Calculate value tool

  • Thanks for your reply, I am glad there's is an explanation. In this case it is really rather inconvinient. Do you know of a workaound? – Mathias Nov 20 '17 at 13:37
  • @Mathias see updated answer. – Hornbydd Nov 20 '17 at 15:16
  • Thanks. Satisfying answer. Although I don't agree with ESRI's logic. – Mathias Nov 22 '17 at 7:12

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.