Model runs in ModelBuilder NOT from My Custom Toolbox in ArcMap

3024
3
01-08-2013 03:52 PM
CandaceCady
New Contributor
Hello Helpful People! 

I just created my first model in ModelBuilder.  It runs beautifully in ModelBuilder; not the case from within my ArcMap project.  Briefly, my model does this: using a list input of FC and geodatabase tables to the Select Layer by Attribute tool I CLEAR_SELECTION.  Then using the same tables as input to the Make Feature Layer and Make Table View tools I apply a series of SQL queries to each table the results of which I Add to Display of the current map.  This model works very nicely within ModelBuilder overwriting previously created output layers.  When I run the model from the custom toolbox in ArcMap the created layers do not overwrite previously created output layers instead they are deleted.  I see a message within ModelBuilder that the the output layer already exists.   I set the Geoprocessing Option within ArcMap to allow Overwriting of Outputs of Geoprocessing Ops.  I am building this model to be used by editors of a versioned ArcSDE Enterprise geodatabase and they shouldn't have to run it from within ModelBuilder.  Any ideas about where I messed up?  Thank you for your time in helping me out.  Oh, yes, and just to control the flow of operation I have placed a precondition connector between the output of each process and the next process.

Candace
0 Kudos
3 Replies
CandaceCady
New Contributor
Hello Again,

The following post by Tom Stephenson back in June of 2010 resolved all my problems with my model.  Wish I had see this before I posted mine.

Thanks to the ESRI Forums.

"modelbuilder result won't add to TOC (cont.)

If you are having trouble getting your Model result added to the table of contents when running your tool from a toolbox, make sure you first have "Add results of geoprocessing operations to the display" ticked on, in the Geoprocessing tab of the File>Options dialog in ArcMap/Catalog. Secondly, you must also have "Add to display", "Model Parameter", AND the "Managed" option all ticked on when you right-click and select the options for your output in Model Builder. This will hide the parameters from the user when run from the toolbox, but should still hopefully add to the display.

.... of course using the "managed" option restricts your output directory and name to teh default path of the input dataset.... gurrr.... back to square one 😞 anyone else?

Tom Stephenson"
0 Kudos
JohnWatermolen
New Contributor II

I am following the instructions and have add to display set, model parameter set, add results to geoprocessing checked. The only thing that I can't do with the described steps is the manage option. It is grayed out and I do not know how to ungray it so I can check it. Have help would be appreciated

0 Kudos
curtvprice
MVP Esteemed Contributor

Managed only applies to intermediate datasets. The reason for that step is to keep intermediate datasets in your model (datasets between two tools) from being deleted at the end of the model tool run, which was happening to Candace.

0 Kudos