Skip to content

Instantly share code, notes, and snippets.

@BrunoCaimar
Created January 11, 2016 19:28
Show Gist options
  • Save BrunoCaimar/44889270e3244ba8434c to your computer and use it in GitHub Desktop.
Save BrunoCaimar/44889270e3244ba8434c to your computer and use it in GitHub Desktop.
Add Layer on MXD
def add_layer_on_mxd(layer_path):
"""
Adiciona uma layer ao mxd atual.
"""
mxd = arcpy.mapping.MapDocument("CURRENT")
data_frames = arcpy.mapping.ListDataFrames(mxd, "*")[0]
newlayer = arcpy.mapping.Layer(layer_path)
arcpy.mapping.AddLayer(data_frames, newlayer, "BOTTOM")
add_layer_on_mxd("IN_MEMORY\FeatureCabos_T2UVATGGKJ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment