Select to view content in your preferred language

Variable Input possible?

4290
9
05-12-2016 10:08 AM
totas
by
New Contributor III

Hi everyone,

I wonder if its possible to create a default input in the model builder, where I can set the origin of the following sequence while running the model.

I want a solution, where I run the created model and the first thing happens is, that a window pops up, where I can set the Raster-Layer as Input for my model.

I would be thankful, if anyone could help me.

Thanks,

Tobias

0 Kudos
9 Replies
ChrisDonohue__GISP
MVP Alum

I'm not sure if this will fully answer your question, but if you set the Input as a Parameter in Modelbuilder, it will allow the user to pick the source when the Model is run.

Here's an example on how it can be done from an ESRI Blog post (in particular, see step 4):

Creating models with interactive input (ModelBuilder 10.0-10.2) | Esri Australia Technical Blog

Chris Donohue, GISP

totas
by
New Contributor III

Thanks for your help, but sadly it didn't solve my problem. I created a sequence of tools with a specific "start-input-raster". So, if I run the model I only can choose the input-raster, which I set in the model builder itself. Otherwise I get an error.

I don't know how to edit my model, so that I can run the model and choose a random Raster-Dataset wherefore the tools are doing there work.

Any Ideas?

Thanks,

Tobias

0 Kudos
WesMiller
Regular Contributor III

Have a look at this link Tutorial: Creating tools with ModelBuilder—Help | ArcGIS for Desktop

You should be able to right click your model and choose edit to edit your model. Once you are editing your model you can right click and make a parameter from any variable in your model.

totas
by
New Contributor III

Yeah, you're right, but I need ONE raster-dataset, wherefore the model works. If I determine two or more input-files as parameter and run the model they only show up and have no further sense, because the only Input which is connected to the first tool still is the one from the beginning. And you only can link one Input with a tool right?

Thanks,

Tobias

0 Kudos
WesMiller
Regular Contributor III

You can also do multiple inputs or batch processing. Depends on what your needs are and how you've set up your processes.Could you give a good description of what your model does and some examples of what you are trying to accomplish?

curtvprice
MVP Esteemed Contributor

If you want to provide inputs outside of the normal dialog (including reading a path generated from the last time a tool was run) you may want to look into the Calculate Value model tool.   You can write a little Python function within that tool to do whatever you want, including writing and reading data to/from text files. This requires a little Python knowledge.

totas
by
New Contributor III

AH... Stupid me. Made a small mistake.

It's working now.

Thanks guys!

0 Kudos
curtvprice
MVP Esteemed Contributor

Can you be more specific, just for the good of the thread?

0 Kudos
totas
by
New Contributor III

What I was trying to accomplish with the whole model is irrelevant.

But the first step of the sequence of tools was a reclassification. I wanted to create a variable input, so that I could choose a random dataset in the beginning of the running model.

I knew that the parameter settings would let me choose a source, but because my first element in the model was a dataset I determined in the beginning of the model building process I wasn't able to choose another one. There was my mistake.

Now I deleted the determined dataset, created a new variable "Raster-Dataset", set it as parameter and linked it with the reclassification tool.

Now everything works fine.