<?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: Create new label class with python? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430419#M33824</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Within a forest inventory I want to label certain types of forest polygons differently, as well as wetlands and other non-forest features. How do I post my python script!? (this is my first time posting a question here!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Oct 2014 22:22:39 GMT</pubDate>
    <dc:creator>DerrickKo_Heinrichs</dc:creator>
    <dc:date>2014-10-16T22:22:39Z</dc:date>
    <item>
      <title>Create new label class with python?</title>
      <link>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430417#M33822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unsuccessfully trying to create a new label class using python. Forums have been helpful for figuring out python for the label class SQL query &amp;amp; expression, but now I want to add another class with a new query &amp;amp; expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 19:56:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430417#M33822</guid>
      <dc:creator>DerrickKo_Heinrichs</dc:creator>
      <dc:date>2014-10-16T19:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create new label class with python?</title>
      <link>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430418#M33823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what example are you working with?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 22:06:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430418#M33823</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-10-16T22:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create new label class with python?</title>
      <link>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430419#M33824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Within a forest inventory I want to label certain types of forest polygons differently, as well as wetlands and other non-forest features. How do I post my python script!? (this is my first time posting a question here!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 22:22:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430419#M33824</guid>
      <dc:creator>DerrickKo_Heinrichs</dc:creator>
      <dc:date>2014-10-16T22:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create new label class with python?</title>
      <link>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430420#M33825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;copy and paste it here then use the Advanced Editor in the top right of the post frame then look for the &amp;gt;&amp;gt; then select syntax highlighting and select python&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 22:32:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430420#M33825</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-10-16T22:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create new label class with python?</title>
      <link>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430421#M33826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's what I've got so far. I'm relatively new to python &amp;amp; have learned by trial &amp;amp; error &amp;amp; reading through these forums. What the below seems to do is rename the 'Default' label class. How do I add a new label class?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14135563955864872" jivemacro_uid="_14135563955864872" modifiedtitle="true"&gt;
&lt;P&gt;# Create Label Class for Single Layer Forested polys&lt;/P&gt;
&lt;P&gt;for lyr in arcpy.mapping.ListLayers (mxd):&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.name == MAPSHEET:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.supports("LABELCLASSES"):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for lblclass in lyr.labelClasses:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblclass.showClassLabels = True&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblclass.className = "FLsingle" &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblclass.SQLQuery = "\"CANLAY\" = 'S' AND \"US2CANLAY\" IS NULL"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblclass.expression = "\"{0}\" + [CANLAY] +&amp;nbsp; \" - CC:\"&amp;nbsp; +&amp;nbsp; [CC] + \"{1}\"".format("&amp;lt;CLR red='0' blue='255' green='0'&amp;gt;&amp;lt;FNT size = '11'&amp;gt;","&amp;lt;/FNT&amp;gt;&amp;lt;/CLR&amp;gt;") # expression is currently incomplete&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.showLabels = True&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView()&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 14:40:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-label-class-with-python/m-p/430421#M33826</guid>
      <dc:creator>DerrickKo_Heinrichs</dc:creator>
      <dc:date>2014-10-17T14:40:47Z</dc:date>
    </item>
  </channel>
</rss>

