Hey I have troubles with If/else statements in ArcGis Modelbulider. I have imported TauDEM Toolbox to work with D-infinity algorythm. Since D-Infinity only works with .tif raster files
I wanted to check first if the input raster is an .tif raster. After checking i want to start either D-infinity if the return value is true. If its not i want to convert it.
For that i tried to use the "Calculate Value" Tool with that code
Expression:
check_if_Tiff("%DGM%")
Codeblock:
def check_if_Tiff(DGM):
import arcpy
desc = arcpy.Describe(DGM)
type = desc.format
if type == "TIFF":
return "true"
else:
return "false"
so far so good but i dont know how to catch the return values to use them in another tool. I also dont understand what for is the tool "Merge Branch" cause i only get one return value
I read this documentation https://blogs.esri.com/esri/arcgis/2011/06/06/modelbuilderifthenelse1/ but i cant completely follow it. Do I have to do this with an python script or is there a way
like I am trying?
Rather than going to great lengths to check for all possible things that can go wrong, or provide options as you go, wouldn't it be easier to
This might make the flow easier
ModelBuilder doesn't provide a functionality to implement if-then-else logic out of the box. You would have to leverage python to implement this, but there are several approaches you can take. Try taking a look at the following page to see if this may be easier for you to implement.
Using If-Then-Else logic for branching—Help | ArcGIS for Desktop