Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

where did my polygon go?

$
0
0
I'm again at work on some legacy code, and I'm stumpled on why one bit is not working as I'd expect. Here is the code snippet:

Code:

def poly2xylist(layer):
    arcpy.CopyFeatures_management(layer, r"C:\Temp\workdammit.shp")
    layercopy = arcpy.CreateScratchName("xxxx", "", "shapefile")
    arcpy.MakeFeatureLayer_management(layer, "layercopy")
    howmany = (arcpy.GetCount_management("layercopy").getOutput(0))
    arcpy.AddMessage("howmany is " + howmany)

When this function is called, howmany comes out as 0. Yet, if I look at my test output (workdammit) in ArcMap, I do have a polygon feature in there, in the attribute table. So where does it 'go'? I'm stumped, here.

Viewing all articles
Browse latest Browse all 2485

Trending Articles