Toolman101

Apply Symbology From Layer File Issue

Discussion created by Toolman101 on Aug 1, 2011
I have a script that generates a shapefile of zones in my state which have a boil order in effect.  So when the script runs, the zones with boil orders and the valid times of the boil orders will almost always change.  That part works fine.

I want to display the shapefile so that the expiration time always displays in the legend.  To do that, I imported the shapefile into ArcMap, clicked on Properties > Symbology > Show Categories > Unique Values.  I unchecked <all other values> and selected the attribute for expiration time as the Value Field.  I also set the colors and borders for the zones to my preference.  I then saved the shapefile off as a layer file so that I could always reference these settings in the future.

Here's the problem: When a new shapefile is created, it does not display in arcmap.  Even though the attribute name of the expiration time is always the same, when there is a different value in there, it causes the shapefile display to be blank. 

When I use python ApplySymbologyFromLayer or UpdateLayer commands, the layer will display and the valid time does update in the legend.  BUT, the layer colors revert back to the generic random color rather than the colors and border settings I need.  Can't have the colors always display different.

Spent many hours trying to work this out but no luck.  Any ideas how to get around this.

Outcomes