Hi Dan, thanks so much for your reply and thanks for pointing me to the code formatting info. This was my first time posting code in a forum and I simply copied and pasted not knowing there was another way. I think I understand what you are suggesting, and it was the original way I tried to complete this task. Below, I tried to create a polyline from an array, shoot it into an empty list (below called featureList), then use the CopyFeatures_management to create an output feature class from the featureList list, however, that did not work either. Below is that attempt. You may notice this is slightly different than my original post (there is an additional 'if' statement testing variables and determine if it should draw a polyline), however, I took all that out trying to simplify things until I figured out how to get any line to actually draw. Is this what you were thinking? Or did I misinterpret your suggestion?
import arcpy
arcpy.env.workspace = r"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb"
arcpy.env.overwriteOutput = True
featureList = []
fc = r"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb\SurveyPointsUTM19_TestSet_Short_6"
arcpy.MakeFeatureLayer_management(fc, "fc_lyr")
sort_fields = [["FILEID", "ASCENDING"], ["EVENTNO", "ASCENDING"]]
fc_Sorted = arcpy.Sort_management("fc_lyr", "fc_sort", sort_fields)
fields = ['FILEID', 'BEAUFORT', 'LEGTYPE', 'LEGSTAGE', 'VISIBLTY', 'MONTH', 'YEAR', "SHAPE@"]
with arcpy.da.SearchCursor(fc_Sorted, fields) as cur:
for row in cur:
fileid1 = row[0]
beaufort = row[1]
legtype = row[2]
legstage = row[3]
visiblty = row[4]
month = row[5]
year = row[6]
geom1 = row[7].getPart()
next(cur)
fileid2 = row[0]
geom2 = row[7].getPart()
array = arcpy.Array()
if ((fileid1 == fileid2) and (beaufort != None and beaufort <= 4) and (visiblty != None and visiblty >= 2)) and \
(not legtype == '0') and \
(not (legtype == '7' and legstage == ' ')) and \
(not (legtype == '9' and legstage == ' ')) and \
(not (legtype == '5' and legstage == ' ')):
array.add(geom1)
array.add(geom2)
polyline = arcpy.Polyline(array, arcpy.SpatialReference(26919))
featureList.append(polyline)
array.removeAll()
else:
pass
del cur
outputLines = arcpy.CopyFeatures_management(featureList, r"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb\OnEffortLines6")