4

I have a model that runs a series of reclass calculations on a Feature Layer

I want to run several "summary statistics" tools in different locations to allow testing/ viewing of the results of the sequential relcass operations.

The "summary statistics" must be run as a precondition to the next reclass operation, because each time a new reclass is conducted, the data changes. So the point in time at which the summary statistics runs is important.

My issue is - I would ideally like to be able to control these summary statistics tool runs to be optional - via a single Boolean tick box. This would allow an option to run the model without all these separate summary statistics - in order to reduce model run time.

My question is - is there any way to make all the summary statistics calculations optional, e.g. via a Boolean tick-box? but still when run for the summary statistics to run in the correct locations, e.g. like a precondition.

The main issues are:

  • If the model is set with a precondition, but the Boolean tick-box is turned off then the main model will not run
  • I know I could run a copy feature from each stage of the model and save to disk, or in memory and then have the summary statistics run on those copies, however this would not result in any time saving
  • I can't use a set of make feature layers and use them as the source for the summary statistics because the underlying feature layer data changes during the model run
  • I have looked into if then else commands and branching, but I can't see how to use this, without having to make lots of copies of the data at each split when two branches are created

Any thoughts / tips would be appreciated!

a section of the model - this is repeated many times

  • 3
    I know this is not really an answer but I find that when the logic gets too complex for model builder its time to abandon it in favour of scripting it in python. In python you could create all the if/then but/else/if logic you can desire! – Hornbydd Nov 13 '13 at 15:42
  • Hi, thanks yes, up to a point I would agree. However there are much higher time costs to learning Python code if you are not from a coding background, whilst anyone can learn ModelBuilder. In general there is a way to do it in ModelBuilder its just there are not many examples out there of more complex models, or combinations of tools. – user21053 Nov 13 '13 at 16:32
  • I agree with @Hornbydd - to implement the logic you describe I would either recommend pure Python/ArcPy or incorporate some Python Script Tools within the model to handle that logic. Either way the learning curve to do anything like this in ArcPy/Python is far less steep than trying to bend ModelBuilder to do so. – PolyGeo Nov 13 '13 at 22:21
  • Have a look for a brown coloured book called python for arcgis, it's an excellent introduction to using arcpy and starts with a crash course in python. – Hornbydd Nov 14 '13 at 9:00
1

A solution to this issue is as follows, using a sub model.

A sub model is created which includes two branches, using the merge branch tool. One branch is created using a simple calculation such as Calculate Value 1+1. The output of the merge branch is then set as the precondition to the main model. The sub model always produces an output, so the precondition always occurs and the main model always runs.

In the sub model a Boolean tick box, set as a parameter, can then be used to set up a series of calculations that if run would then reach the merge branch tool.

This can be used to run any series of optional calculations or analysis part way through a model progress, e.g. checking Summary Statistics etc

0

I would try making the connection from "Output Values" to the copy features a precondition. Then make sure that Output Values is a string rather then a number which will make sure it doesn't act as a boolean precondition for Coppy features but it will happen first. If you need the Value of Output Value as an input to Copy features use the %Value% substitution. I hope that works, I'm not 100% certain that I understood the problem correctly.

  • thanks, your comment that there is a difference between number and text outputs acting as Boolean preconditions is useful. However the issue I was having was that I wanted to use the first Boolean tick box to control whether this section of the model ran or did not run. If this model section contains a precondition and the initial tick box is turned off then the main model will then not run. – user21053 Feb 18 '14 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.