AnsweredAssumed Answered

Apply Symbology w/out adding layer to map.

Question asked by wtgeographer on Apr 11, 2014
Latest reply on Apr 11, 2014 by wtgeographer
I am using 10.2 which now apparently adds layer to map upon using arcpy.ApplySymbologyFromLayer_management (). I am trying to add symbology to layer and then add layer at a specific position in the dataframe using arcpy.mapping.InsertLayer().  I am looking for a way of accomplishing this w/out adding layer twice? Thanks in advance...

        layer1 = arcpy.mapping.ListLayers(mxd, "AP_Map_Numbers", df)[0]          symbologyLayer = r'G:\Texas\Potter-Randall\Database\Ownership.lyr'          #create a search cursor to get relevant information about a parcel         sc = arcpy.SearchCursor(layer1)          #for loop to get the selected data         for row in sc:             #select the relevant fields to be put on the map             ap = row.getValue("MAP_NUMBER")             addLayer = arcpy.mapping.Layer(r'G:\Texas\Potter-Randall\Database' + \                         '\\' + str(ap) + '\\' + str(ap) + ".gdb" + '\\' + str(ap))             arcpy.ApplySymbologyFromLayer_management(addLayer, symbologyLayer)             arcpy.mapping.InsertLayer(df, layer1, addLayer, "BEFORE")