Select to view content in your preferred language

Problems with symbology on arcpy.mapping

2032
2
03-01-2013 07:27 AM
LeticiaNascimento
Emerging Contributor
I have a layer that I added on a mxd through arcpy. However, the symbologyTipe is comming as "OTHER" and I need it to take the symbology as a UNIQUE CLASS. I can't change it and I tryed the UpdateLayer, but nothing happens to my layer. I tryed both in my script and following it on ArcMap.

I also tryed "arcpy.ApplySymbologyFromLayer_management" but it didn't work either.

Does someone knows how to do this?

Thanks!
Tags (2)
0 Kudos
2 Replies
JeffBarrette
Esri Regular Contributor
The only way to change a symbology type in arcpy is via update layer.  Can you tell us more about the layer that is failing and the code you are using?

Thanks,
Jeff
0 Kudos
LeticiaNascimento
Emerging Contributor
Hello, Jeff!

My code is something like this:

import arcpy.mapping as MP
lyrboias = MP.Layer("c:/GIS_tutorial/SHP/BOIAS_PAC.shp")
lyrboias.name = "Boias"
molde_boias = MP.Layer("c:/GIS/Boias_molde.lyr")
MP.AddLayer(df, lyrboias, "TOP")
updateLayer = MP.ListLayers(mxd, "Boias", df)[0]
MP.UpdateLayer(df, updateLayer, molde_boias, False)

However, I noticed that it is, in fact, updating the "molde_boias". The problem is: in my shape called lyrboias I have an item in the attribute table called "Tipo". I need it to classify the SHP in the two classes I have inside the "Tipo" attribute and collered it with green and red.

Thank you for your help!

Letícia
0 Kudos