AnsweredAssumed Answered

GetCount_management coding issue

Question asked by claudines on Mar 8, 2013
Latest reply on Mar 9, 2013 by curtvprice
This python code I thought was stating that if projectFile was a polygon and had more than one polygon, dissolve it and make the zoneFile equal to the dissolve file. Otherwise, make the zoneFile equal to projectFile. Ideas? Using ArcGIS 10.1. It is dissolving all polygon shapefiles, regardless of whether there is just one polygon or multiple polygons.

projectFile = shapefileDir + "\\" + base + ".shp" if shapeType == "Polygon":     arcpy.AddMessage(shapeType)     if int(arcpy.GetCount_management(projectFile).getOutput(0)) > 0: # I also used > 1 with no change         dissolveFile = geodatabaseLocation + "_Dissolve"         arcpy.Dissolve_management(projectFile, dissolveFile,"", "", "SINGLE_PART", "DISSOLVE_LINES")         arcpy.AddMessage("Dissolving multipolygons")         zoneFile = dissolveFile     else:         zoneFile = shapefileDir + "\\" + base + ".shp"
 

Thank you in advance.

Outcomes