cfoster15

Adding a Layer

Discussion created by cfoster15 on Sep 26, 2011
Latest reply on Sep 27, 2011 by frankv3
I am trying to write a script that will create a feature and then add that feature into a dataframe in a mxd:

I keep getting Runtime error <type 'exceptions.AssertionError'>:

Here is my code:
mxd = arcpy.mapping.MapDocument ("CURRENT")
df = arcpy.mapping.ListDataFrames (mxd, "DC_TR")[0]
temp_tr = (r"T:\1_DOUGLAS_PROJECTS\A_CLIENT_PROJECTS_ARC\1_INTERNAL_CLIENTS\A_GENERAL_FUND\1_ASSESSOR\ASSESSORS.gdb\TEMP\TEMP_TR")
arcpy.mapping.AddLayer (df, temp_tr, "TOP")
lyr = (r"T:\1_DOUGLAS_PROJECTS\A_CLIENT_PROJECTS_ARC\1_INTERNAL_CLIENTS\A_GENERAL_FUND\1_ASSESSOR\TEMP_TR.lyr")

I am also trying to update the layer with an existing layer file:

arcpy.mapping.UpdateLayer (df, temp_tr, lyr, True)

Outcomes