Solved! Go to Solution.
# Process: Create Mapbook Document, Data Frame, and Layer Objects mxd = mapping.MapDocument(r"V:\gislu\_BasemapMXD\10.1 MXDS\PreApp_Location.mxd") df = mapping.ListDataFrames(mxd, "PreApp Location")[0] Layer = mapping.ListLayers(mxd, "Parcels", df)[0] #Process: Select Layer by Attributes whereClause = "\"ADDRNO\" = " + NUMBER + " AND \"ADDRSTREET\" = '" + STREET + "'" arcpy.AddMessage("SELECTING: " + whereClause) arcpy.SelectLayerByAttribute_management (Layer, "NEW_SELECTION", whereClause) arcpy.AddMessage(arcpy.GetCount_management(Layer).getOutput(0)) #Process: Update the mapbook display in ArcMap df.zoomToSelectedFeatures() for Layer in mapping.ListLayers(mxd, "Parcels", df): if [acreage] < str(153): df.scale = 5000 else: df.scale = 9000 arcpy.RefreshActiveView() arcpy.RefreshTOC() legend = mapping.ListLayoutElements(mxd, "LEGEND_ELEMENT", "Legend")[0] legend.autoAdd = True
if df.scale <= 5000: df.scale = 5000 elif df.scale <= 9000: df.scale = 9000
int([acreage]) < 153, without the quotes around 153.
# Process: Create Mapbook Document, Data Frame, and Layer Objects mxd = mapping.MapDocument(r"V:\gislu\_BasemapMXD\10.1 MXDS\PreApp_Location.mxd") df = mapping.ListDataFrames(mxd, "PreApp Location")[0] Layer = mapping.ListLayers(mxd, "Parcels", df)[0] #Process: Select Layer by Attributes whereClause = "\"ADDRNO\" = " + NUMBER + " AND \"ADDRSTREET\" = '" + STREET + "'" arcpy.AddMessage("SELECTING: " + whereClause) arcpy.SelectLayerByAttribute_management (Layer, "NEW_SELECTION", whereClause) arcpy.AddMessage(arcpy.GetCount_management(Layer).getOutput(0)) #Process: Update the mapbook display in ArcMap df.zoomToSelectedFeatures() for Layer in mapping.ListLayers(mxd, "Parcels", df): if [acreage] < str(153): df.scale = 5000 else: df.scale = 9000 arcpy.RefreshActiveView() arcpy.RefreshTOC() legend = mapping.ListLayoutElements(mxd, "LEGEND_ELEMENT", "Legend")[0] legend.autoAdd = True
if df.scale <= 5000: df.scale = 5000 elif df.scale <= 9000: df.scale = 9000