Skip to main content
added 127 characters in body
Source Link
roms
  • 446
  • 2
  • 8

Using two cursors should accomplish what you want. You should be able to do your selection and run something like this in arc map python console:

with arcpy.da.SearchCursor(pavementPolys, ['GUID']) as pavement:
  with arcpy.da.InsertCursor(treatmentTable, ['GUID']) as treatments:
    for street in pavement:
      treatments.insertRow([street[0]])

This will insert a single new treatment row with that GUID for each selected pavement feature. If you've got a list of treatments elsewhere, you could work that into the code too to insert all the necessarymultiple rows at oncerepresenting multiple treatments done on a single pavement feature. Or you could make this into a toolbox script that will accept a selection and a treatment, and have it insert the treatment value into the table toofor each row. This would give you a more interactive way to approach the problem.

Using two cursors should accomplish what you want. You should be able to do your selection and run something like this in arc map python console:

with arcpy.da.SearchCursor(pavementPolys, ['GUID']) as pavement:
  with arcpy.da.InsertCursor(treatmentTable, ['GUID']) as treatments:
    for street in pavement:
      treatments.insertRow([street[0]])

This will insert a single new treatment row with that GUID for each selected pavement feature. If you've got a list of treatments elsewhere, you could work that into the code too to insert all the necessary rows at once. Or you could make this into a toolbox script that will accept a selection and a treatment, and have it insert the treatment value into the table too.

Using two cursors should accomplish what you want. You should be able to do your selection and run something like this in arc map python console:

with arcpy.da.SearchCursor(pavementPolys, ['GUID']) as pavement:
  with arcpy.da.InsertCursor(treatmentTable, ['GUID']) as treatments:
    for street in pavement:
      treatments.insertRow([street[0]])

This will insert a single new treatment row with that GUID for each selected pavement feature. If you've got a list of treatments elsewhere, you could work that into the code too to insert multiple rows representing multiple treatments done on a single pavement feature. Or you could make this into a toolbox script that will accept a selection and a treatment, and have it insert the treatment value into the table for each row. This would give you a more interactive way to approach the problem.

Source Link
roms
  • 446
  • 2
  • 8

Using two cursors should accomplish what you want. You should be able to do your selection and run something like this in arc map python console:

with arcpy.da.SearchCursor(pavementPolys, ['GUID']) as pavement:
  with arcpy.da.InsertCursor(treatmentTable, ['GUID']) as treatments:
    for street in pavement:
      treatments.insertRow([street[0]])

This will insert a single new treatment row with that GUID for each selected pavement feature. If you've got a list of treatments elsewhere, you could work that into the code too to insert all the necessary rows at once. Or you could make this into a toolbox script that will accept a selection and a treatment, and have it insert the treatment value into the table too.