ralaua

¿Can I change symbology of layer from "OTHER" to  "UNIQUE_VALUES" ?

Discussion created by ralaua on Mar 18, 2016
Latest reply on Mar 22, 2016 by Dan_Patterson

When I add a layer this by default  is "OTHER", I want to apply unique value by default  programmatically by some field.

 

import arcpy
dirmxd = "D:\Borrrar\D143\Ejecutables\D143v10_3.mxd"
fc = "D:\Borrrar\D143\BaseMapas.gdb\estruclin"
mxd=arcpy.mapping.MapDocument(mxd)
df = arcpy.mapping.ListDataFrames(mxd)[0]
layer = arcpy.MakeFeatureLayer_management(fc,"estruc")
lyr = arcpy.mapping.Layer(layer)
arcpy.mapping.AddLayer(df, lyr, "AUTO_ARRANGE")
tipo = lyr.symbologyType ### print OTHER

 

I don´t have a lyr, I have a general style  that I want to apply with class styleItem: legend.updateItem(lyr, styleItem)

I seen a example: http://desktop.arcgis.com/es/desktop/latest/analyze/arcpy-mapping/styleitem-class.htm

but first I need a layer classify by unique value.

 

Perhaps I have to generate the classified layer before add, but I don't know how to do it without ever having another layer of reference.

 

 

  Thanks and regards...



Outcomes