<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic add one layer to another using arcpy.mp in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/add-one-layer-to-another-using-arcpy-mp/m-p/1158246#M64174</link>
    <description>&lt;P&gt;So I have 3 maps in an ArcGIS Pro project. one map (colorado) has a layer called "baseball_field" but the other two maps don't have the baseball field layer. I want to add the&amp;nbsp; baseball_field layer from the colorado map to the other two maps without hardcoding their names. and the layer baseball_fieldl should not be added again to the colorado maps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is what I have so far but I am getting errors...&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;aprx_path = "C:/myprojects.aprx"&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(aprx_path)&lt;/P&gt;&lt;P&gt;maps = aprx.listMaps("colorado")[0]&lt;/P&gt;&lt;P&gt;lyr = my_maps.listLayers("baseball_field")[0]&lt;/P&gt;&lt;P&gt;maps_1 = aprx.listMaps()[1:]&lt;/P&gt;&lt;P&gt;for m in maps_1:&lt;BR /&gt;lyrs = m.listLayers()&lt;/P&gt;&lt;P&gt;maps_1.addLayer(lyr, "BOTTOM")&lt;/P&gt;&lt;P&gt;aprx.saveACopy("Copy.aprx")&lt;/P&gt;&lt;P&gt;del aprx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Mar 2022 03:47:52 GMT</pubDate>
    <dc:creator>AmandaYoung_95</dc:creator>
    <dc:date>2022-03-28T03:47:52Z</dc:date>
    <item>
      <title>add one layer to another using arcpy.mp</title>
      <link>https://community.esri.com/t5/python-questions/add-one-layer-to-another-using-arcpy-mp/m-p/1158246#M64174</link>
      <description>&lt;P&gt;So I have 3 maps in an ArcGIS Pro project. one map (colorado) has a layer called "baseball_field" but the other two maps don't have the baseball field layer. I want to add the&amp;nbsp; baseball_field layer from the colorado map to the other two maps without hardcoding their names. and the layer baseball_fieldl should not be added again to the colorado maps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is what I have so far but I am getting errors...&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;aprx_path = "C:/myprojects.aprx"&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(aprx_path)&lt;/P&gt;&lt;P&gt;maps = aprx.listMaps("colorado")[0]&lt;/P&gt;&lt;P&gt;lyr = my_maps.listLayers("baseball_field")[0]&lt;/P&gt;&lt;P&gt;maps_1 = aprx.listMaps()[1:]&lt;/P&gt;&lt;P&gt;for m in maps_1:&lt;BR /&gt;lyrs = m.listLayers()&lt;/P&gt;&lt;P&gt;maps_1.addLayer(lyr, "BOTTOM")&lt;/P&gt;&lt;P&gt;aprx.saveACopy("Copy.aprx")&lt;/P&gt;&lt;P&gt;del aprx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 03:47:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-one-layer-to-another-using-arcpy-mp/m-p/1158246#M64174</guid>
      <dc:creator>AmandaYoung_95</dc:creator>
      <dc:date>2022-03-28T03:47:52Z</dc:date>
    </item>
  </channel>
</rss>

