if not self.centerline.isNull(suffix): self.newStreet.S_suffix = self.centerline.getValue(suffix)
Solved! Go to Solution.
I have not run into this specifically, but what about putting in some error handling to allow your code to continue on past these rows?
Implement the Try-Except block statement.
Regards,
Jim
try: if not self.centerline.isNull(name): self.newStreet.S_name = self.centerline.getValue(name) except: pass try: if not self.centerline.isNull(prefix): self.newStreet.S_prefix = self.centerline.getValue(prefix) except: pass try: if not self.centerline.isNull(suffix): self.newStreet.S_suffix = self.centerline.getValue(suffix) except: pass try: if not self.centerline.isNull(type): self.newStreet.S_type = self.centerline.getValue(type) except: pass
fields = ['fld1', 'fld2', 'fld3'] for field in fields: where = field + " IS NOT NULL" try: with arcpy.da.SearchCursor(fc, fields, where) as cursor: for row in cursor: value = row[0] print field + ": " + str(value) #or use "value" to do something except Error: pass del row, cursor
if self.centerline.getValue(suffix) is not None: self.newStreet.S_suffix = self.centerline.getValue(suffix)