AnsweredAssumed Answered

Passing distance on arcpy.MultipleRingBuffer_analysis

Question asked by Tonyalmeida on Mar 18, 2014
Latest reply on Mar 18, 2014 by Tonyalmeida
I am trying to create an user input for the Distance parameter for arcpy.MultipleRingBuffer_analysis with the following but it's giving me an error on line 54 which is arcpy.MultipleRingBuffer_analysis tool. I am assuming it is not recognizing the GetParameterAsText but i am not sure why? any help/input would be great. thanks.

import arcpy, string, os  arcpy.env.overwriteOutput = True mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] lyr = arcpy.mapping.ListLayers(mxd, "TAXLOTS")[0]  arcpy.env.workspace = os.path.dirname(mxd.filePath) wp = os.path.dirname(mxd.filePath)  values = arcpy.GetParameterAsText(0) fieldName = "DXF_TEXT" values = values.split(";")  # split values into list values = ["'{0}'".format(v) for v in values] # add single quotes whereClause = "{0} IN ({1})".format(fieldName, ",".join(values)) arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", whereClause)  Name = arcpy.GetParameterAsText(1) for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):     if elm.text == "Template":         elm.text = Name  Distance = (arcpy.GetParameterAsText(2)) if Distance == '#' or not Distance:     Distance = "600" # provide a default value if unspecified  df.extent = lyr.getSelectedExtent() df.scale = 24000    if int(arcpy.GetCount_management("TAXLOTS").getOutput(0)) > 0:     arcpy.Select_analysis("TAXLOTS", "SUBJECT_PROPERTY")  arcpy.SelectLayerByAttribute_management("TAXLOTS", "CLEAR_SELECTION")  del mxd, wp, lyr  mxd = arcpy.mapping.MapDocument("CURRENT") lyr = arcpy.mapping.ListLayers(mxd, "SUBJECT_PROPERTY")[0] #lyrpath = lyr.workspacePath wp = os.path.dirname(mxd.filePath)  SP = "SUBJECT_PROPERTY"  lyr.replaceDataSource(wp, "SHAPEFILE_WORKSPACE", SP, True )  arcpy.RefreshActiveView() arcpy.RefreshTOC()  arcpy.MultipleRingBuffer_analysis(SP, "1_2",[1,2],"Miles","ToBufDist","ALL" ) arcpy.MultipleRingBuffer_analysis(SP, "NOTIFBUF1", Distance,"Feet","ToBufDist","ALL")

Traceback (most recent call last):   File "C:\GIS\Python Scripts\", line 54, in <module>     arcpy.MultipleRingBuffer_analysis(SP, "NOTIFBUF1", Distance,"Feet","ToBufDist","ALL")   File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\", line 849, in MultipleRingBuffer     raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000735: Distances: Value is required Failed to execute (MultipleRingBuffer)