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

asked Nov 20, 2017 at 7:58

1 Answer 1

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

answered Nov 20, 2017 at 13:03
3
  • 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? Commented Nov 20, 2017 at 13:37
  • @Mathias see updated answer. Commented Nov 20, 2017 at 15:16
  • Thanks. Satisfying answer. Although I don't agree with ESRI's logic. Commented Nov 22, 2017 at 7:12

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.