I am trying to do something very simple, but I'm pulling my hair out with this one.
In an ArcGIS python toolbox, for one of my tools I ask the user for a list of feature layers, using the following code in the .pyt file:
def getParameterInfo(self):
"""Define parameter definitions"""
param0 = arcpy.Parameter(
displayName="Input Line Networks",
name="InputFCList",
datatype="GPFeatureLayer",
parameterType="Required",
direction="Input",
multiValue=True)
param0.filter.list = ["Polyline"]
The key parameter here is multiValue=True. Then, in my function (where InputFCList is sent), I use this code to pop off the first item in the list of feature classes:
def main(fcList, fcBndPoly, boolSeg, fcOutCombine):
fcToLine = fcList.pop
# rest of the code...
This code runs fine during testing, when I hard-coded the list of feature classes. However, when running the tool in ArcMap, I get the following error:
AttributeError: 'unicode' object has not attribute 'pop'
According to the ESRI documentation, setting the multiValue parameter to True should allow for the creation of a list of input feature classes, but there's obviously something else going on if it thinks the list is actually a unicode object. Any ideas?
print(type(fcList))
and see what you're actually working with.