<?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: Strange Python vs Arcade symbology issue in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/strange-python-vs-arcade-symbology-issue/m-p/1291324#M67697</link>
    <description>&lt;P&gt;Any chance the label class(es) for TWP+"_QRT_sections" in the map are set to arcade language and the other to Python?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1684539211745.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/71223iA9D3B48DE9E7DC4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1684539211745.png" alt="RhettZufelt_0-1684539211745.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
    <pubDate>Fri, 19 May 2023 23:34:09 GMT</pubDate>
    <dc:creator>RhettZufelt</dc:creator>
    <dc:date>2023-05-19T23:34:09Z</dc:date>
    <item>
      <title>Strange Python vs Arcade symbology issue</title>
      <link>https://community.esri.com/t5/python-questions/strange-python-vs-arcade-symbology-issue/m-p/1291307#M67696</link>
      <description>&lt;P&gt;For the TWP+"_Sections" layer I have to set the&lt;STRONG&gt; lblClass.expression&lt;/STRONG&gt; with python, for the TWP+"_QRT_sections" layer I have to set it with Arcade, otherwise neither layer works! It's the strangest thing. The problem repeats with each new dataset.&lt;/P&gt;&lt;P&gt;Here's the code in question:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for m in aprx.listMaps("Map"):

    for lyr in m.listLayers(TWP+"_Sections"):
        sym = lyr.symbology
        lblClass = lyr.listLabelClasses()[0]
        print("Layer name: " + lyr.name)
        lblClass.expression = "\"&amp;lt;FNT name= 'Arial' size= '14' style= 'bold'&amp;gt;\" + \"&amp;lt;CLR red= '0' green= '38' blue= '138'&amp;gt;\" + [FRSTDIVNO] + \"&amp;lt;/CLR&amp;gt;\" + \"&amp;lt;/FNT&amp;gt;\""
        #lblClass.expression = "\"&amp;lt;FNT name= 'Arial' size= '14' style= 'bold'&amp;gt;\" + \"&amp;lt;CLR red= '0' green= '38' blue= '138'&amp;gt;\" + $feature.FRSTDIVNO + \"&amp;lt;/CLR&amp;gt;\" + \"&amp;lt;/FNT&amp;gt;\""
        lyr.showLabels = True
        sym.renderer.symbol.color = {'RGB' : [0, 0, 0, 0]}
        sym.renderer.symbol.outlineColor = {'RGB' : [0, 38, 138, 100]}
        sym.renderer.symbol.outlineWidth = 4
        lyr.symbology = sym
        p.saveACopy(os.path.join("CURRENT"))


    for lyr in m.listLayers(TWP+"_QRT_sections"):
        sym = lyr.symbology
        lblClass = lyr.listLabelClasses()[0]
        print("Layer name: " + lyr.name)
        #lblClass.expression = "\"&amp;lt;FNT name= 'Arial' size ='10' style= 'bold'&amp;gt;\" + \"&amp;lt;CLR red= '137' green= '137' blue= '68'&amp;gt;\" + [SECDIVNO] + \"&amp;lt;/CLR&amp;gt;\" + \"&amp;lt;/FNT&amp;gt;\""
        lblClass.expression = "\"&amp;lt;FNT name= 'Arial' size ='10' style= 'bold'&amp;gt;\" + \"&amp;lt;CLR red= '137' green= '137' blue= '68'&amp;gt;\" + $feature.SECDIVNO + \"&amp;lt;/CLR&amp;gt;\" + \"&amp;lt;/FNT&amp;gt;\""
        lyr.showLabels = True
        sym.renderer.symbol.color = {'RGB' : [0, 0, 0, 0]}
        sym.renderer.symbol.outlineColor = {'RGB' : [171, 205, 102, 100]}
        sym.renderer.symbol.outlineWidth = 4
        lyr.symbology = sym
        p.saveACopy(os.path.join("CURRENT"))  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 22:18:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-python-vs-arcade-symbology-issue/m-p/1291307#M67696</guid>
      <dc:creator>nsidaniel</dc:creator>
      <dc:date>2023-05-19T22:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Python vs Arcade symbology issue</title>
      <link>https://community.esri.com/t5/python-questions/strange-python-vs-arcade-symbology-issue/m-p/1291324#M67697</link>
      <description>&lt;P&gt;Any chance the label class(es) for TWP+"_QRT_sections" in the map are set to arcade language and the other to Python?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1684539211745.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/71223iA9D3B48DE9E7DC4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1684539211745.png" alt="RhettZufelt_0-1684539211745.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 23:34:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-python-vs-arcade-symbology-issue/m-p/1291324#M67697</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-05-19T23:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Python vs Arcade symbology issue</title>
      <link>https://community.esri.com/t5/python-questions/strange-python-vs-arcade-symbology-issue/m-p/1291348#M67702</link>
      <description>&lt;P&gt;That's probably it. To set the expression engine, you have to use the CIM:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    for lyr in m.listLayers(TWP+"_Sections"):
        cim = lyr.getDefinition("V3")
        for lblClass in cim.labelClasses:
            lblClass.expressionEngine = "Arcade"
        lyr.setDefinition(cim)
        # rest of the code&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 May 2023 12:27:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-python-vs-arcade-symbology-issue/m-p/1291348#M67702</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-05-20T12:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Python vs Arcade symbology issue</title>
      <link>https://community.esri.com/t5/python-questions/strange-python-vs-arcade-symbology-issue/m-p/1291604#M67705</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/15530"&gt;@RhettZufelt&lt;/a&gt; and &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt; . It's always something simple!&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 14:49:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-python-vs-arcade-symbology-issue/m-p/1291604#M67705</guid>
      <dc:creator>nsidaniel</dc:creator>
      <dc:date>2023-05-22T14:49:03Z</dc:date>
    </item>
  </channel>
</rss>

