<?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: Possible to change legend description from a script? Python or C#? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550197#M43018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What type of symbology are you using on your layer?&amp;nbsp; At 10.1 we've added some new symbology options but it depends on the symbology type (e.g., graduated colors, graduated symbols, etc).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also - where in the UI are you changing the layer item descriptions so that it has more than more line per symbol.&amp;nbsp; I'm not able to do it in the UI.&amp;nbsp; I'm trying to do it via layer properties --&amp;gt; symbology tab.&amp;nbsp; For unique value, I select the individual symbol, right-click and select Edit Description.&amp;nbsp; It does NOT allow multiple lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 May 2012 14:19:51 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2012-05-03T14:19:51Z</dc:date>
    <item>
      <title>Possible to change legend description from a script? Python or C#?</title>
      <link>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550196#M43017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a mxd project where layers will be turned on and off as needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the layers will be turned on, they will have valid times.&amp;nbsp; Example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Valid 8:00 PM Monday Sept. 24&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Until 6:00 AM Tuesday Sept. 25&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you see, the valid start/end will be on 2 lines, which can only be accomplished through the legend description.&amp;nbsp; Legend label will only allow text to display on 1 line, which won't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A Layer file is no good due to the unlimited number of possibilities for the valid start/end times.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way in any scripting language (python, C#, etc.) that you can access the legend description and make changes?&amp;nbsp; If so, could you please provide a example of code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks very much for any help I can get.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 13:53:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550196#M43017</guid>
      <dc:creator>NickFillo</dc:creator>
      <dc:date>2012-05-02T13:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to change legend description from a script? Python or C#?</title>
      <link>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550197#M43018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What type of symbology are you using on your layer?&amp;nbsp; At 10.1 we've added some new symbology options but it depends on the symbology type (e.g., graduated colors, graduated symbols, etc).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also - where in the UI are you changing the layer item descriptions so that it has more than more line per symbol.&amp;nbsp; I'm not able to do it in the UI.&amp;nbsp; I'm trying to do it via layer properties --&amp;gt; symbology tab.&amp;nbsp; For unique value, I select the individual symbol, right-click and select Edit Description.&amp;nbsp; It does NOT allow multiple lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 14:19:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550197#M43018</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2012-05-03T14:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to change legend description from a script? Python or C#?</title>
      <link>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550198#M43019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the symbology, I am currently going with "unique values, many fields" because the valid begin and valid end times of my polygons are each a layer attribute.&amp;nbsp; Since the layer is created through a script I wrote, I could adjust the code to combine the beginning/end times into a single attribute and then change the symbology to "unique values".&amp;nbsp; So I do have options there.&amp;nbsp; Each polygon is intended to display as a unique solid color.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem then becomes how to make that value into 2 lines in the legend.&amp;nbsp; We already know we can't make the legend label into 2 lines in 10.0 (and I'm hoping the improvements you mentioned in 10.1 help make this possible in some way or another).&amp;nbsp; Arcpy does not provide a function that allows the legend descriptions to be edited from a script, but I'm wondering if there's a python guru out there who came up with a backdoor way to do it, or if anyone knows how to do this in C# or any other language.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For your second paragraph, I'm not sure I'm answering correctly, but you can make the item descriptions under layer properties &amp;gt; symbology into multiple lines manually.&amp;nbsp; To get to the next line in the description box, you have to hit Ctrl-Enter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 12:03:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550198#M43019</guid>
      <dc:creator>NickFillo</dc:creator>
      <dc:date>2012-05-04T12:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to change legend description from a script? Python or C#?</title>
      <link>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550199#M43020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unfortunately, we did not expose Unique Values, many fields at 10.1.&amp;nbsp; We did expose Unique Values and it is possible to add multiple lines to each description.&amp;nbsp; The example below modifies the descriptions of 2 unique values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
mxd = arcpy.mapping.MapDocument("current")
lyr = arcpy.mapping.ListLayers(mxd, "my Unique Value Layer")[0]
if lyr.symbologyType == "UNIQUE_VALUES":
&amp;nbsp; lyrSym = lyr.symbology
&amp;nbsp; lyrSym.classDescriptions = ["temp1\r\ntemp2", "temp1\r\ntemp2"]
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:48:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550199#M43020</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-12-11T23:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to change legend description from a script? Python or C#?</title>
      <link>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550200#M43021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for you help.&amp;nbsp; The code you provided looks like it should do what I need it to.&amp;nbsp; Can't wait to test it out after upgrading to 10.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 17:25:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/possible-to-change-legend-description-from-a/m-p/550200#M43021</guid>
      <dc:creator>NickFillo</dc:creator>
      <dc:date>2012-05-07T17:25:21Z</dc:date>
    </item>
  </channel>
</rss>

