<?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 Re: How to moveLayers in ArcPro in a Python Toolbox - command not working as documented in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1026755#M59976</link>
    <description>&lt;P&gt;MapInfo!&amp;nbsp; How old school&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; .&amp;nbsp; One of my early favs.&lt;/P&gt;&lt;P&gt;&amp;lt;bored comments&amp;gt;&lt;/P&gt;&lt;P&gt;I wish they would update the global bug list more regularly!&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/" target="_blank"&gt;Esri Support | ArcGIS Technical Support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And your correct answer still stands (and your current answer is even better).&lt;/P&gt;&lt;P&gt;As for python tools.&amp;nbsp; I prefer the conventional ones where you have a dialog to fill in the parameters.&amp;nbsp; You get to screen grab the parameter dialog for documentation purposes and if you want to do the fancy-schmancy validating thing, you can even do it there.&amp;nbsp; (note... the toolbox structure is changing if you haven't noticed... all the toolboxes in&amp;nbsp; the&lt;/P&gt;&lt;P&gt;C:\&lt;EM&gt;YourInstallFolder&lt;/EM&gt;\Resources\ArcToolBox\toolboxes&lt;/P&gt;&lt;P&gt;are now folders with "stuff" inside and the *.tbx files might become a thing of the past.&lt;/P&gt;&lt;P&gt;You will get used to it, and things will change&lt;/P&gt;&lt;P&gt;&amp;lt;back to numpy&amp;gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Feb 2021 03:14:54 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-02-15T03:14:54Z</dc:date>
    <item>
      <title>How to moveLayers in ArcPro in a Python Toolbox - command not working as documented</title>
      <link>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1005099#M59135</link>
      <description>&lt;P&gt;ArcGIS Pro version 2.4.0&lt;BR /&gt;I have a Python Toolbox script to reorder the layers in my Current Map as follows:&lt;/P&gt;&lt;PRE&gt;currentProject  = arcpy.mp.ArcGISProject(&lt;SPAN class="hljs-string"&gt;"CURRENT"&lt;/SPAN&gt;)
currentMap = currentProject.listMaps()[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;] &lt;SPAN class="hljs-comment"&gt;# this assumes  one map&lt;/SPAN&gt;
layers = currentMap.listLayers()
             
&lt;SPAN class="hljs-comment"&gt;#LGA  the very bottom&lt;/SPAN&gt;
SPATIALDATA_LYR= currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'SPATIALDATA_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
LGA_LYR= currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'LGA_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
currentMap.moveLayer(SPATIALDATA_LYR,LGA_LYR,&lt;SPAN class="hljs-string"&gt;"AFTER"&lt;/SPAN&gt;) &lt;SPAN class="hljs-comment"&gt;# LGA below Spatial&lt;/SPAN&gt;

&lt;SPAN class="hljs-comment"&gt;#Property&lt;/SPAN&gt;
SPATIALDATA_LYR= currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'SPATIALDATA_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
PROPERTY_LYR= currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'PROPERTY_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
currentMap.moveLayer(SPATIALDATA_LYR,PROPERTY_LYR,&lt;SPAN class="hljs-string"&gt;"AFTER"&lt;/SPAN&gt;) &lt;SPAN class="hljs-comment"&gt;#Prop below spatial&lt;/SPAN&gt;

&lt;SPAN class="hljs-comment"&gt;# 13    UGB_LYR All UGB line work that overlaps the LGA Layer&lt;/SPAN&gt;
SPATIALDATA_LYR= currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'SPATIALDATA_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
UGB_LYR = currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'UGB_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
currentMap.moveLayer(SPATIALDATA_LYR,UGB_LYR,&lt;SPAN class="hljs-string"&gt;"BEFORE"&lt;/SPAN&gt;) &lt;SPAN class="hljs-comment"&gt;#above&lt;/SPAN&gt;
    
&lt;SPAN class="hljs-comment"&gt;# 12    HERITAGE_LYR    Join between SPATIALDATA and excel HEADERS&lt;/SPAN&gt;
SPATIALDATA_LYR= currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'SPATIALDATA_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
HERITAGE_LYR = currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'HERITAGE_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
currentMap.moveLayer(SPATIALDATA_LYR,HERITAGE_LYR,&lt;SPAN class="hljs-string"&gt;"BEFORE"&lt;/SPAN&gt;) &lt;SPAN class="hljs-comment"&gt;#above&lt;/SPAN&gt;

    
&lt;SPAN class="hljs-comment"&gt;# 11    TOP_10_LYR  Top 10 Sales&lt;/SPAN&gt;
SPATIALDATA_LYR= currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'SPATIALDATA_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
TOP_10_LYR = currentMap.listLayers(&lt;SPAN class="hljs-string"&gt;'TOP_10_LYR'&lt;/SPAN&gt;)[&lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;]
currentMap.moveLayer(SPATIALDATA_LYR,TOP_10_LYR,&lt;SPAN class="hljs-string"&gt;"BEFORE"&lt;/SPAN&gt;) &lt;SPAN class="hljs-comment"&gt;#above&lt;BR /&gt;&lt;BR /&gt;return&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The Layers are being moved but the results seem to be quite random and the order in my debugging doesn't match the order shown in the Drawing Order pane&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 23:26:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1005099#M59135</guid>
      <dc:creator>LeandraGordon</dc:creator>
      <dc:date>2020-12-02T23:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to moveLayers in ArcPro in a Python Toolbox - command not working as documented</title>
      <link>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1019026#M59595</link>
      <description>&lt;P&gt;****crickets*****************&lt;/P&gt;&lt;P&gt;No this isn't the solution and I didn't accept it.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 02:40:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1019026#M59595</guid>
      <dc:creator>LeandraGordon</dc:creator>
      <dc:date>2021-02-15T02:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to moveLayers in ArcPro in a Python Toolbox - command not working as documented</title>
      <link>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1026232#M59930</link>
      <description>&lt;P&gt;Not following your "random" and "order in the debugging" but at least you got some resolution so I will assume it worked? (posting the link would be nice)&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 12:32:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1026232#M59930</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-02-12T12:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to moveLayers in ArcPro in a Python Toolbox - command not working as documented</title>
      <link>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1026749#M59973</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;***cackles loudly*** No it's been accepted as a bug by ESRI Australia and is now logged with ESRI USA. So no, no resolution. I'm waiting for the case to appear in MyESRI and I'll link to it there...with my other bug.&lt;BR /&gt;&lt;BR /&gt;&amp;lt;rant&amp;gt; I'm reasonably new to ESRI and Pro (we are in the process of migrating from Mapinfo). In general I have found it pretty good if you want to do a one off map and upload it to the web (and spend a couple of days fiddling to make it look the way it should). If you want to automate via Arcpy or Model Builder it is very buggy, things just don't do what they say on the box. In my mind this isn't acceptable for something that, in Australia, costs a lot of money. The support we get from ESRI Australia is great but I am starting to see why:&lt;BR /&gt;1. QGIS is used a lot in smaller businesses, like local government.&lt;BR /&gt;2. Users haven't migrated to Pro.&lt;BR /&gt;&amp;lt;/rant&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 02:38:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1026749#M59973</guid>
      <dc:creator>LeandraGordon</dc:creator>
      <dc:date>2021-02-15T02:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to moveLayers in ArcPro in a Python Toolbox - command not working as documented</title>
      <link>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1026755#M59976</link>
      <description>&lt;P&gt;MapInfo!&amp;nbsp; How old school&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; .&amp;nbsp; One of my early favs.&lt;/P&gt;&lt;P&gt;&amp;lt;bored comments&amp;gt;&lt;/P&gt;&lt;P&gt;I wish they would update the global bug list more regularly!&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/" target="_blank"&gt;Esri Support | ArcGIS Technical Support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And your correct answer still stands (and your current answer is even better).&lt;/P&gt;&lt;P&gt;As for python tools.&amp;nbsp; I prefer the conventional ones where you have a dialog to fill in the parameters.&amp;nbsp; You get to screen grab the parameter dialog for documentation purposes and if you want to do the fancy-schmancy validating thing, you can even do it there.&amp;nbsp; (note... the toolbox structure is changing if you haven't noticed... all the toolboxes in&amp;nbsp; the&lt;/P&gt;&lt;P&gt;C:\&lt;EM&gt;YourInstallFolder&lt;/EM&gt;\Resources\ArcToolBox\toolboxes&lt;/P&gt;&lt;P&gt;are now folders with "stuff" inside and the *.tbx files might become a thing of the past.&lt;/P&gt;&lt;P&gt;You will get used to it, and things will change&lt;/P&gt;&lt;P&gt;&amp;lt;back to numpy&amp;gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 03:14:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1026755#M59976</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-02-15T03:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to moveLayers in ArcPro in a Python Toolbox - command not working as documented</title>
      <link>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1026762#M59977</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;You will get used to it, and things will change"&lt;BR /&gt;Getting my users to reorder the layers every time isn't such a big ask.&lt;BR /&gt;The bugs with Apply Symbology from Layer (bugs in a python toolbox, bugs when used in model builder) are another thing altogether. The commentary on Geonet also makes me think that this is an issue that has been going on for years.&lt;BR /&gt;If I can't get a decent automated workflow up and running my users will abandon ESRI except for a couple of licences to produce something fancy for presentations and that's it. That's a fair bit of $$.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 04:29:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1026762#M59977</guid>
      <dc:creator>LeandraGordon</dc:creator>
      <dc:date>2021-02-15T04:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to moveLayers in ArcPro in a Python Toolbox - command not working as documented</title>
      <link>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1039127#M60514</link>
      <description>&lt;P&gt;Got it logged as a bug: &lt;A href="https://my.esri.com/#/support/bugs/BUG-000138288" target="_blank"&gt;https://my.esri.com/#/support/bugs/BUG-000138288&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Excuse me coming across as a little whiney but I understand ESRI products in the USA are quite cheap per user, which explains why users in the US users tend to put up with a lot more. ESRI in Australia and elsewhere is VERY expensive per seat so we do expect things to pretty much, well, work.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Mar 2021 22:37:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-movelayers-in-arcpro-in-a-python-toolbox/m-p/1039127#M60514</guid>
      <dc:creator>LeandraGordon</dc:creator>
      <dc:date>2021-03-21T22:37:13Z</dc:date>
    </item>
  </channel>
</rss>

