AnsweredAssumed Answered

Empty output generated with python script tool in model builder?

Question asked by RP.CObb on Mar 4, 2020
Latest reply on Mar 4, 2020 by RP.CObb

Hi,

 

So I have been trying to figure out why some of my script tools work and some don't. They are very simple and straight forward, but for some reason they don't generate an output. I am using the script below in conjunction with other added variables in the model that I am working on.

import arcpy
arcpy.env.overwriteOutput = True

#Set parameters
inputList = arcpy.GetParameterAsText(0)

w = ''.join(list(inputList))

x = w.find('-')

if x > 0:
    y = w.replace('-', '_')
    if y.find(';') > 0:
        z = y.replace(';','_')

        print z
        #Output Parameter
        arcpy.SetParameterAsText(1, z)

        #Add Message
        arcpy.AddMessage('string {} added'.format(z))

 

I have the input set to any values with multivalue set to yes.

 

If anyone has any ideas on how or why this isn't working and could help me with this I would greatly appreciate it.

 

Robert

Outcomes