Jump to content

 
Photo

From script to Model Builder

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Mark Boucher

Mark Boucher

    Newbie

  • New Member
  • Pip
  • 9 posts
  • Gender:Male
  • Location:Martinez, California
  • Interests:Hydrology <br />Hydraulics<br />Watershed Analysis
  • United States

Is there a way to convert a script from python into Model Builder?

I needed to do some repetitive steps in Model Builder. I started in Model Builder (MB), making several of the steps. MB seems to do a bunch of background work and it really makes this type of repetitive "programing" slow. So I exported my model to python and copied the script over an over again using find/replace to change the parameters. It not as "visual" but was much faster than working in MB. Then I wanted to bring it back into MB, but could only get it back in as a script and it would not convert it into the visual "flow chart" presentation.

Any tools to do that?
Mark
"We may not be big, but we're slow."

#2
spg

spg

    Contributor

  • Validated Member
  • PipPip
  • 17 posts
  • New Zealand

The short answer is "No".

However, as you have seen, you can use a script in a model. If all you are doing is changing parameters then you could simplify your Python script and plug in the parameters via Modelbuilder, or break your script into multiple parts and plug it into the model as appropriate. or write the whole thing in Python as it sounds like you're nearly there anyway.
Although you can also use parameters and variables in Modelbuilder, you may get performance benefits by being able to use cursors etc in Python.

If you really want the flowchart view then you will have to build it all in Modelbuilder from scratch. You can copy and paste within modelbuilder.


Is there a way to convert a script from python into Model Builder?

I needed to do some repetitive steps in Model Builder. I started in Model Builder (MB), making several of the steps. MB seems to do a bunch of background work and it really makes this type of repetitive "programing" slow. So I exported my model to python and copied the script over an over again using find/replace to change the parameters. It not as "visual" but was much faster than working in MB. Then I wanted to bring it back into MB, but could only get it back in as a script and it would not convert it into the visual "flow chart" presentation.

Any tools to do that?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->