TransWikia.com

How can I add a custom-named output to TOC which is a managed data in ModelBuilder

Geographic Information Systems Asked by Arian Osroosh on January 8, 2021

I’m trying to make a model using the ModelBuilder. Everything is working properly, except the fact that I want to add the outputs to TOC with the specific layer name.
The problem is that in order to add an output to TOC (Table of Contents), the output should be marked as “add to display” and also as a Parameter at the same time.

Marking an output as a parameters, appears a saving directory option to the model dialogue box, which I don’t want it to happen. I don’t want to enable the final user to be able to edit the name or saving directory of the output. but I want the data to be displayed!

If I mark the “managed” option in addition to the “add to display” and “Parameter”, the output will be added to the TOC with random name, ignoring the specific name.

Am I missing something? I would be thankful if you guys can help me out.

p.s: I am not using any iterators.

One Answer

It's going to be a very big struggle to do this using ModelBuilder. What you want to do goes against a lot of the framework conventions.

If you want something to be added to your TOC, it needs to be a parameter. (Add to display is only used when running the model in 'edit' mode). If something is a parameter, generally the user of the tool will be able to update/modify it.

Your only solution will be to look at using a derived output parameter. In ModelBuilder you can't change output types. If a tool by default has a 'required output', you can't modify that to derived. You could create a script tool with an input parameter of String to get a name, and then set an output derived parameter and use the internal script to create the feature class with said name and have it added to the TOC (because it's a parameter)

Answered by KHibma on January 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP