2

I have a point layer "SurfaceLocation". It has a data field called "AgeRank". One of the values it can be is "M".

In Modelbuilder, I want to take that layer, select only the points that have a value of "M", and create a new layer in the Table of Contents. I'm using the "Make Feature Layer" tool. I use "SurfaceLocation" as the input, apply the correct expression, name the Output layer "Minors" and set the output to "Add to Display".

I run this and nothing happens. No new layer appears in the Table of Contents. When I try running it again, I get an error saying the Output Layer "Minors" already exists. It's not in the Table of Contents, so where is it?

I've tried closing and relaunching ArcMap. I've tried rebuilding this in a new model (and it still says it already exists). "Add results of geoprocessing operations to the display" is checked in geoprocessing options.

I've reviewed ModelBuilder not adding output feature class to Table of Contents? and decided to post this question because that didn't have an answer that worked for me. I was hoping for answers that I could use.

I've tried making the output layer a parameter. When I run the model, it doesn't even show up at the beginning for a value (the start parameter does). Unfortunately, I don't know a thing about python yet. I was hoping there was a tool that I couldn't find that would do this.

Further explanation: Not sure why this simple problem can't have a simple solution.

The model is an oval (layer input) a rectangle (Make Feature Layer) and another oval (layer output). I want the input to be an existing layer without any definition query. I want the tool to apply the definition query and output another layer into the TOC. I do not want to create another feature class. The model doesn't have to look like this. If I need to string a couple of tools together to do it, that's fine.

* If I was doing this manually, I'd right click on the first layer, select copy, paste it, rename it, and add a definition query. Then I would "Apply symbology from layer". *

I can't find a tool that does this. "Make Feature Layer" doesn't put it in the TOC. It puts it in_memory. That would be fine if I could then find a tool that takes it out of memory and adds it to the TOC. Being in_memory doesn't help me. I want to display it, not do any processing to it.

1

If you post your workflow, it will be clear where your error is. I just tested the workflow you described, and I get the layer in my TOC.

Here is my model. I have ticked 'Add to Display' on the output layer:

Here are my 'Make Feature Layer' settings:

Your query will need to be AgeRank = 'M'

When I run the model, the layer shows up in the TOC and shows the correct subset based on my query:

Please try this workflow and let us know if you still get errors.

0

You said:

When I try running it again, I get an error saying the Output Layer "Minors" already exists. It's not in the Table of Contents, so where is it?

I suspect that the precise error message may say that the feature class named "Minors" already exists rather than the layer named "Minors".

To find the former, look in the Catalog window of ArcMap.

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.
{"cc_re__cc_re__cc_by_sa_4_0": ["-item\"><a href=\"https://twitter.com/stackoverflow\" class=\"-link js-gps-track\" data-gps-track=\"footer.click({ location: 2, link: 32 })\">Twitter</a></li>\r\n                    <li class=\"-item\"><a href=\"https://linkedin.com/company/stack-overflow\" class=\"-link js-gps-track\" data-gps-track=\"footer.click({ location: 2, link: 33 })\">LinkedIn</a></li>\r\n                </ul>\r\n\r\n                <p class=\"mt-auto mb24\">\r\nsite design / logo &#169; 2019 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/4.0/\" class=\"js-gps-track\" data-gps-track=\"footer.click({ location: 2, link: 34 })\" rel=\"license\">cc by-sa 4.0</a>\r\n                            with <a href=\"https://stackoverflow.blog/2009/06/25/attribution-required/\"  class=\"js-gps-track\" data-gps-track=\"footer.click({ location: 2, link:35 })\" rel=\"license\">attribution required</a>.\r\n                    <span id=\"svnrev\">rev&nbsp;2019.9.20.34984</span>\r\n                </p>\r\n            </div>\r\n        </div>\r\n\r\n            </footer>\r\n            <script>StackExchange.ready(function () { StackExchange.responsiveness.addSwitcher(); })</scri"], "copyright__copyright__copyright": ["g the Output Layer \"Minors\" already exists. It's not in the Table of Contents, so where is it?\n\nI suspect that the precise error message may say that the feature class named \"Minors\" already exists rather than the layer named \"Minors\".\n\nTo find the former, look in the Catalog window of ArcMap.\n\nYour Answer\n\nBy clicking \u201cPost Your Answer\u201d, you agree to our terms of service, privacy policy and cookie policy\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}