I want to create polylines linking a bunch of points. Individual polylines must be created between every point. I started by reading the x & y cords and then created unique pairs as well as all combinations. Unfortunately my python is lacking and I'm also stuck with ArcGIS 10.0.
import arcpy import itertools mxd = arcpy.mapping.MapDocument("CURRENT") myt = () newt = () pairt = () # Get the XY coords from the point featureclass inputfc = 'C:\\Temp\\testing.gdb\\BunchofPoints' desc = arcpy.Describe(infc) shapename = desc.ShapeFieldName rows = arcpy.SearchCursor(inputfc) for row in rows: feat = row.getValue(shapename) pnt = feat.getPart() myt = myt +((pnt.X),(pnt.Y)) #Create pairs newt =zip(myt[::2],myt[1::2]) #Create combinations for pair in itertools.combinations(newt,2): pairt = pairt + pair #Check print pairt #Create lines mypoint = arcpy.Point() myarray = arcpy.Array() featList =  for feature in pairt: for coPair in feature: mypoint.X = coPair mypoint.Y = coPair myarray.add(mypoint) polyline = arcpy.Polyline(myarray) myarray.removeAll() featList.append(polyline) arcpy.CopyFeatures_management(featureList, 'C:\\Temp\\all_lines.shp')
I get the following error: Runtime error : 'float' object is unsubscriptable
I'm struggling with how to read the pair of coordinates I've created and also with creating the individual lines.