Original User: armein01Hi again,I am trying to develop an application which dissolves adjacent polygons and then assigns a new unitID for the dissolved polys.
uRows = arcpy.SearchCursor("wtlndUnits1")
wtlndUnitID = 1
for uRow in uRows:
arcpy.SelectLayerByLocation_management("wtlnd4Anlys","WITHIN",uRow.shape, "", "NEW_SELECTION")
numPolys = int(arcpy.GetCount_management("wtlnd4Anlys").getOutput(0))
if numPolys > 1:
#Get total area using the geometry
g = arcpy.Geometry()
totalArea = 0
gList = arcpy.CopyFeatures_management("wtlnd4Anlys",g)
for geometry in gList:
totalArea += geometry.area
arcpy.CalculateField_management("wtlnd4Anlys", "UnitAcres", totalArea * 0.00024711, "Python")
arcpy.CalculateField_management("wtlnd4Anlys", "WtlndUnitID", wtlndUnitID, "PYTHON")
wtlndUnitID += 1
del uRow, uRows
So, Only polygons that have been dissolved are updated with an UnitID. This works, but I started the process Friday and when I returned this morning it was still running then shortly after I came in it stopped.The acres field was not updated either, but no error was thrown by the code. Here is a shot of the polygons that were updated.[ATTACH=CONFIG]34103[/ATTACH]So do I need to clean up somewhere, so the code can complete, why oh why is it taking so long and last why is it not populating the totalAcres. This is the first time Ive tried to use geometry, I can switch to a search cursor for the total area.ThanksAlicia