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.

  • Make Feature Layer stores that layer in memory, not in the TOC. You can use Delete to remove a layer made by Make Feature Layer. – Midavalo Sep 15 '16 at 0:08
  • OK - don't know what "in memory" means - I'll research that. So how do I get a new layer in the TOC? – Corinne Sep 15 '16 at 0:18
  • 3
    have a look at gis.stackexchange.com/questions/66862/… – Midavalo Sep 15 '16 at 0:33
  • 2
    Sorry for my unhelpful answer. Can you post a screenshot of the model? maybe it will be more clear. – Mattropolis Sep 15 '16 at 1:20
  • 1
    I still think this is probably a duplicate of gis.stackexchange.com/questions/66862 I think you may need to provide a much more detailed description of your steps leading up to your problem and the symptoms that you see. I suggest using some test data and a test model to do this so that you can show us exactly what they look like. – PolyGeo Sep 16 '16 at 23:07
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: enter image description here

enter image description here

Here are my 'Make Feature Layer' settings:

Your query will need to be AgeRank = 'M'

enter image description here

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

enter image description here

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

  • Your model looks exactly like mine. Your workflow looks exactly like mine. Your parameter input looks exactly like mine. I have "add to display" checked. I don't get a new layer. Then when I try to run it again, it says it already exists. – Corinne Sep 20 '16 at 16:58
  • What happens when you run the make feature layer tool outside of model builder? Does the layer show up in TOC? – jbalk Sep 20 '16 at 23:46
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.