AnsweredAssumed Answered

using cursor to load data

Question asked by PSoares on Mar 20, 2020
Latest reply on Mar 20, 2020 by PSoares

Hi,

using ArcMap 10.5.

look i want to simply load the data from one gdb to other gdb... but on my first attempt the geometry of polygons and lines was not uploaded. I read in the forums that i needed to include the "SHAPE@". I tried as such, but the result is bad... i cannot understand how to fix it. The error message is: AttributeError: 'unicode' object has no attribute editable.

can someone suggest me something?

cheers

P

        env.workspace = datasets[0]
        fcs = arcpy.ListFeatureClasses()

        for fc in fcs:
            #print '\t', fc
            count=count_records(fc)   # counts the features within each FC
            if count<>"0":
                listfields = arcpy.ListFields(fc)
                for l in range(len(listfields)):
##                    listfields[l] = listfields[l].name
##                    print listfields
                    listfields = [f.name for f in listfields if f.editable and f.type != "Geometry"] + ["SHAPE@"]
                with arcpy.da.SearchCursor(fc,listfields) as cur:

                    with arcpy.da.InsertCursor(GDBDwgs + "\\" + fc, l) as icur:

                        for row in cur:
                            print '\t', fc
                            icur.insertRow(row)
                    del icur
                del cur

Outcomes