<?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 Edit symbol layer drawing using python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/edit-symbol-layer-drawing-using-python/m-p/1033312#M60223</link>
    <description>&lt;P&gt;I am using ArcGIS Pro 2.7 and I am currently working on creating layouts with geocoded data points. The data is stored in csv-files, after creating a feature class from this a new layer is created using a python toolbox. When introducing a graduated colors renderer data points overlapping each other are stacked in arbitrary order (as far as I understand based on the order they were returned from the database).&lt;/P&gt;&lt;P&gt;In ArcGIS Pro, what I have been doing to dictate the order in which data points are drawn is the following: Enable Symbol layer drawing and rearrange the different symbol layers using drag and drop in the layers symbology.&lt;/P&gt;&lt;P&gt;Trying to automate this using a python toolbox, my idea was to edit the layers CIM definition to achieve the same result:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;lyr0 = map0.listLayers(FLname)[0]&lt;BR /&gt;cim_lyr = lyr0.getDefinition('V2')&lt;/P&gt;&lt;P&gt;# Edit CIM&lt;BR /&gt;cim_lyr.symbolLayerDrawing.useSymbolLayerDrawing = True&lt;BR /&gt;&lt;BR /&gt;cim_lyr.symbolLayerDrawing.symbolLayers.reverse()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;lyr0.setDefinition(cim_lyr)&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;However, when running this the drawing order seemingly does not change. The symbol layer drawing button in the symbology is not enabled and the symbol layers are no longer listed in the symbology. Instead, a warning appears "Requested operation could not be completed" :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HansR_0-1614938568769.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7619i9E89A563E3FEAF31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HansR_0-1614938568769.png" alt="HansR_0-1614938568769.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since this is my first post in this forum: did this question end up in the right spot?&lt;/P&gt;&lt;P&gt;Am I missing something here?&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 10:16:24 GMT</pubDate>
    <dc:creator>HansR</dc:creator>
    <dc:date>2021-03-05T10:16:24Z</dc:date>
    <item>
      <title>Edit symbol layer drawing using python</title>
      <link>https://community.esri.com/t5/python-questions/edit-symbol-layer-drawing-using-python/m-p/1033312#M60223</link>
      <description>&lt;P&gt;I am using ArcGIS Pro 2.7 and I am currently working on creating layouts with geocoded data points. The data is stored in csv-files, after creating a feature class from this a new layer is created using a python toolbox. When introducing a graduated colors renderer data points overlapping each other are stacked in arbitrary order (as far as I understand based on the order they were returned from the database).&lt;/P&gt;&lt;P&gt;In ArcGIS Pro, what I have been doing to dictate the order in which data points are drawn is the following: Enable Symbol layer drawing and rearrange the different symbol layers using drag and drop in the layers symbology.&lt;/P&gt;&lt;P&gt;Trying to automate this using a python toolbox, my idea was to edit the layers CIM definition to achieve the same result:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;lyr0 = map0.listLayers(FLname)[0]&lt;BR /&gt;cim_lyr = lyr0.getDefinition('V2')&lt;/P&gt;&lt;P&gt;# Edit CIM&lt;BR /&gt;cim_lyr.symbolLayerDrawing.useSymbolLayerDrawing = True&lt;BR /&gt;&lt;BR /&gt;cim_lyr.symbolLayerDrawing.symbolLayers.reverse()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;lyr0.setDefinition(cim_lyr)&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;However, when running this the drawing order seemingly does not change. The symbol layer drawing button in the symbology is not enabled and the symbol layers are no longer listed in the symbology. Instead, a warning appears "Requested operation could not be completed" :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HansR_0-1614938568769.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7619i9E89A563E3FEAF31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HansR_0-1614938568769.png" alt="HansR_0-1614938568769.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since this is my first post in this forum: did this question end up in the right spot?&lt;/P&gt;&lt;P&gt;Am I missing something here?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 10:16:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/edit-symbol-layer-drawing-using-python/m-p/1033312#M60223</guid>
      <dc:creator>HansR</dc:creator>
      <dc:date>2021-03-05T10:16:24Z</dc:date>
    </item>
  </channel>
</rss>

