0

At 10.7.1, I have a simple model that is supposed to add the final FGDB feature class to the ArcMap display:

enter image description here

I also have the correct Geoprocessing option set:

enter image description here

I run the tool in ArcMap by double-clicking it from its toolbox, not from within the editor window, as explained in this SE GIS post.

Sadly, the feature class is not added to the display. However, the model really does create the feature class, and I can manually add it to the display.

What am I missing?

  • I think the 'Add to Display' only works when you run the model it's editor window. Does it work when you run it that way? – Son of a Beach Mar 24 '20 at 23:46
2

You need to make the final output feature class a model parameter. The Add to Display setting is only used when run in "Edit mode" (ie from the ModelBuilder window).

When running as a tool, outputs need to be parameters if you want them added to the map.

  • Unfortunately, the output location is critical (and thus must be hard-coded), so I can't risk exposing that path location to the user as a parameter. Additionally, this model will be stored as a toolbar button, and therefore cannot be run in edit mode. Sigh... this is like an automobile company telling me that their latest model comes with air conditioning - only to find that it will only work in the arctic winter with the windows rolled down. I feel like I'm in ESRI hell. – Stu Smith Mar 25 '20 at 23:29
  • Mmmm, not to be unsympathetic, but this is the GP framework and how it's worked forever. If you want interaction with the map, from within the app, you need parameters, whether they are input or output. You could maybe build a small Python script tool that imports/runs your model and then you make use of a derived, output parameter. User doesn't see derived in the UI despite it being a parameter because its handled by the tool itself. – KHibma Mar 25 '20 at 23:54
0

Eureka! It is possible to add the output of a Modelbuilder model to the ArcMap Table of Contents without exposing it as a user parameter!

How? Simply add the Collect Values tool as the last step in the model. Connect the previously last step to Collect Values, then parameterize Collect Values. Simple!

I inadvertently stumbled across the answer in the Collect Values tool help:

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.