Hi So I am working a project to create these maps and I am trying to get symbology to change but I cant
import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True
file_workspace = 'N:\\GIS\\Projects\\AA_Leith_Hawkins_TestBed\\Search_Cursor\\Search_Cursor.gdb'
env.workspace = file_workspace
Holdings = 'N:\\GIS\\Projects\\AA_Leith_Hawkins_TestBed\\Search_Cursor\\Search_Cursor.gdb\\Data\\Holdings'
distances = [1000, 4000]
unit = "Meters"
arcpy.MakeFeatureLayer_management(Holdings,'Holdings_Layer')
with arcpy.da.SearchCursor(Holdings, ['Holding_Reference_Number'])as Holdings_Ref_cursor:
for row in Holdings_Ref_cursor:
print row[0]
query = "Holding_Reference_Number = " + str(row[0])
print query
File_output = file_workspace+ '\\' 'Buffer_'+str(row[0])
arcpy.SelectLayerByAttribute_management('Holdings_Layer', 'NEW_SELECTION',"Holding_Reference_Number = " + str(row[0]))
Holding_Boundary = file_workspace+ '\\' 'Holding_'+str(row[0])
arcpy.management.CopyFeatures('Holdings_Layer', Holding_Boundary)
arcpy.MultipleRingBuffer_analysis('Holdings_Layer', File_output, distances, unit, "", "ALL")
arcpy.MakeFeatureLayer_management(File_output, 'Buffer_Layer')
print 'Buffer complete'
Intersect_out_features = file_workspace+ '\\' 'Intersect_'+str(row[0])
arcpy.Intersect_analysis([Holdings,File_output],Intersect_out_features, "", "", "INPUT")
print "intersect Complete"
Drop_Fields = ['FID_Holdings','Holding_Reference_Number','Holding_Location_Address','Local_Land_Services_Region_Id',
'Local_Land_Services_Region_Name', 'RLPB_Board_Name', 'Property_Identification_Code','Occupier_Id',
'Occupier_Full_Name','Occupier_Mailing_Address','Occupier_Home_Phone','Occupier_Mobile_Phone',
'Occupier_Email_Address', 'Total_Area', 'Is_Rateable_Indicator','Rateable_Area','Nominal_Notional_Carrying_Cap',
'FID_Buffer_108050022']
arcpy.DeleteField_management(Intersect_out_features,Drop_Fields)
arcpy.MakeFeatureLayer_management(Intersect_out_features, 'Intersect_Layer')
Intersect_Selection_Excel = 'distance = 1000'
print Intersect_Selection_Excel
arcpy.SelectLayerByAttribute_management('Intersect_Layer', 'NEW_SELECTION', Intersect_Selection_Excel)
Excel_Output = 'N:\\GIS\\Projects\\AA_Leith_Hawkins_TestBed\\Search_Cursor\\'
Excel_Location = Excel_Output + '\\' +str(row[0])+'.xls'
print Excel_Location
arcpy.TableToExcel_conversion('Intersect_Layer', Excel_Location)
mxd = arcpy.mapping.MapDocument('N:\\GIS\Projects\\AA_Leith_Hawkins_TestBed\\Search_Cursor\\Search_Cursor_mxd.mxd')
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
addLayer = arcpy.mapping.Layer(File_output)
addLayer2 = arcpy.mapping.Layer(Holding_Boundary)
addLayer3 = arcpy.mapping.Layer(Intersect_out_features)
arcpy.mapping.AddLayer(df, addLayer, "TOP")
print addLayer
arcpy.mapping.AddLayer(df, addLayer2, "TOP")
print addLayer2
arcpy.mapping.AddLayer(df, addLayer3, "TOP")
print addLayer3
arcpy.RefreshActiveView()
arcpy.ApplySymbologyFromLayer_management('Buffer_Layer', 'C:\\Database_connections\\assesment_Model_lyr\\Buffer.lyr')
arcpy.ApplySymbologyFromLayer_management('Holdings_Layer', 'C:\\Database_connections\\assesment_Model_lyr\\Holding.lyr')
arcpy.ApplySymbologyFromLayer_management('Intersect_Layer', 'C:\\Database_connections\\assesment_Model_lyr\\Intersect.lyr')
arcpy.RefreshActiveView()
print df
lyr = arcpy.mapping.ListLayers(mxd, '', df)[2]
print lyr.name
extent = lyr.getExtent()
print extent
df.extent = extent
Png_output = "N:\\GIS\Projects\\AA_Leith_Hawkins_TestBed\\" + str(row[0]) + '.png'
arcpy.mapping.ExportToPNG(mxd,Png_output)
print 'Map Created'
del mxd
I cant work out where I need to call the Change symbology from ive had a look through the syntax guide but I think I must be a bit slow
Should I be calling the layer file or the layers I am adding to the Dataframe ??