Python to model builder

234
5
Jump to solution
09-14-2021 03:35 PM
SoratoSouza_e_Silva
Occasional Contributor II
I would like to transform a python script into model builder, but not as a single box, but as its separate functions and connections, how do I do that?
0 Kudos
1 Solution

Accepted Solutions
BlakeTerhune
MVP Regular Contributor

There's nothing that will do this automatically. You will have to build the model manually based on the geoprocessing tasks the script uses. If the script has some advanced logic, you may not be able to create a model capable of completely replicating the script. What is the need to have a model instead of a script?

View solution in original post

5 Replies
BlakeTerhune
MVP Regular Contributor

There's nothing that will do this automatically. You will have to build the model manually based on the geoprocessing tasks the script uses. If the script has some advanced logic, you may not be able to create a model capable of completely replicating the script. What is the need to have a model instead of a script?

View solution in original post

SoratoSouza_e_Silva
Occasional Contributor II

I need to transform the python scripts to another platform, but to understand what was done in this script, in the model builder for me it's easier. I didn't make the current script

0 Kudos
DuncanHornby
MVP Frequent Contributor

As @BlakeTerhune says you cannot convert a script into a model. You do not say how your current script is run? Are you aware you can expose a script as a tool script so it looks like a single geoprocessing tool which you can drop into an existing model?

0 Kudos
SoratoSouza_e_Silva
Occasional Contributor II

Current I use like script as a tool script so it looks like a single geoprocessing, but I would like to see as image below

 

Thakn´ssample-model-gis-1.png

0 Kudos
DuncanHornby
MVP Frequent Contributor

There is no way to turn that logic encapsulated by a script into its equivalent in model builder. Also consider this, python allows complex looping and logic structure as well an importing functionality from other modules, e.g. scipy, numpy, fiona etc... these are all modules/logic that model builder has no concept of.

0 Kudos