<?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 Pro equivalent to arcpy.mapping.MoveLayer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/pro-equivalent-to-arcpy-mapping-movelayer/m-p/1001306#M59050</link>
    <description>&lt;P&gt;I need to move some layers in my layout and I am not seeing how to do this in Pro through python. Am I not seeing it or is there no way to do this in Pro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcMap&lt;/P&gt;&lt;P&gt;df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]&lt;BR /&gt;for lyr in arcpy.mapping.ListLayers(mxd, "" ,df):&lt;BR /&gt;if lyr.name == "Sections":&lt;BR /&gt;moveLayer = lyr&lt;BR /&gt;if lyr.name == "TaxParcels":&lt;BR /&gt;refLayer = lyr&lt;BR /&gt;arcpy.mapping.MoveLayer(df,refLayer,moveLayer,"BEFORE")&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2020 18:09:42 GMT</pubDate>
    <dc:creator>2Quiker</dc:creator>
    <dc:date>2020-11-13T18:09:42Z</dc:date>
    <item>
      <title>Pro equivalent to arcpy.mapping.MoveLayer</title>
      <link>https://community.esri.com/t5/python-questions/pro-equivalent-to-arcpy-mapping-movelayer/m-p/1001306#M59050</link>
      <description>&lt;P&gt;I need to move some layers in my layout and I am not seeing how to do this in Pro through python. Am I not seeing it or is there no way to do this in Pro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcMap&lt;/P&gt;&lt;P&gt;df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]&lt;BR /&gt;for lyr in arcpy.mapping.ListLayers(mxd, "" ,df):&lt;BR /&gt;if lyr.name == "Sections":&lt;BR /&gt;moveLayer = lyr&lt;BR /&gt;if lyr.name == "TaxParcels":&lt;BR /&gt;refLayer = lyr&lt;BR /&gt;arcpy.mapping.MoveLayer(df,refLayer,moveLayer,"BEFORE")&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 18:09:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pro-equivalent-to-arcpy-mapping-movelayer/m-p/1001306#M59050</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2020-11-13T18:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pro equivalent to arcpy.mapping.MoveLayer</title>
      <link>https://community.esri.com/t5/python-questions/pro-equivalent-to-arcpy-mapping-movelayer/m-p/1001334#M59051</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/layerfile-class.htm" target="_self"&gt;arcpy/mapping/layerfile-class&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;moveLayer (reference_layer, move_layer, {insert_position})&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Provides the ability to move a layer or group layer in a layer file to a specific location in the layer stack.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this move layer?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 19:07:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pro-equivalent-to-arcpy-mapping-movelayer/m-p/1001334#M59051</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-11-13T19:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pro equivalent to arcpy.mapping.MoveLayer</title>
      <link>https://community.esri.com/t5/python-questions/pro-equivalent-to-arcpy-mapping-movelayer/m-p/1001372#M59052</link>
      <description>&lt;P&gt;I tried to use the following but get error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;m = aprx.listMaps()[0]&lt;BR /&gt;#for lyr in m.listLayers():&lt;BR /&gt;m.moveLayer("Taxparcels","Sections","BEFORE")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 7, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\utils.py", line 191, in fn_&lt;BR /&gt;return fn(*args, **kw)&lt;BR /&gt;File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\_mp.py", line 1802, in moveLayer&lt;BR /&gt;return convertArcObjectToPythonObject(self._arc_object.moveLayer(*gp_fixargs((reference_layer, move_layer, insert_position), True)))&lt;BR /&gt;ValueError: Sections&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 20:36:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pro-equivalent-to-arcpy-mapping-movelayer/m-p/1001372#M59052</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2020-11-13T20:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pro equivalent to arcpy.mapping.MoveLayer</title>
      <link>https://community.esri.com/t5/python-questions/pro-equivalent-to-arcpy-mapping-movelayer/m-p/1001396#M59053</link>
      <description>&lt;P&gt;I was able to move the layer. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;m = aprx.listMaps()[0]&lt;BR /&gt;for lyr in m.listLayers():&lt;BR /&gt;print("Map: {0} Layers".format(lyr.name))&lt;BR /&gt;for lyr in m.listLayers():&lt;BR /&gt;if lyr.name == "Sections":&lt;BR /&gt;moveLayer = lyr&lt;BR /&gt;if lyr.name == "Taxparcels":&lt;BR /&gt;refLayer = lyr&lt;BR /&gt;m.moveLayer(refLayer,moveLayer,"BEFORE")&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 20:51:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pro-equivalent-to-arcpy-mapping-movelayer/m-p/1001396#M59053</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2020-11-13T20:51:40Z</dc:date>
    </item>
  </channel>
</rss>

