AnsweredAssumed Answered

How can I catch a return Value from “Calculate Value” to start another Tool in ArcGis Model builder?

Question asked by Max2603 on Apr 8, 2016
Latest reply on Apr 8, 2016 by FGibson-esristaff

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?

Outcomes