AnsweredAssumed Answered

Zoom to FC

Question asked by jsmith0705 on Oct 15, 2013
Latest reply on Oct 16, 2013 by jsmith0705
When a Fields polygon is selected the script zooms to the polygon extent.  But, I want to return the AddMessage line if the correct Feature Class is not selected. The script does not get to the else statement for other Feature Classes. But, when another polygon or polyline Feature Class is selected it zooms to full extent, as expected. So, why does the script not use the else statement for Feature Classes other than Fields?

fds = arcpy.mapping.ListLayers(mxd, "Fields", df)[0] for fds in arcpy.mapping.ListLayers(fds):     desc = arcpy.Describe(fds)     type = desc.shapeType     if type == "Polygon":        df.extent = fds.getSelectedExtent()     else:        arcpy.AddMessage("Fields polygon not selected")

Outcomes