<?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 add labels using arcpy  in Map Advice Community Questions</title>
    <link>https://community.esri.com/t5/map-advice-community-questions/how-to-add-labels-using-arcpy/m-p/876996#M227</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for reporting this.&amp;nbsp; We just addressed this very recently (post 2.5 final).&amp;nbsp; Unfortunately, refresh isn't happening in the UI but you are seeing the correctly results in the export.&amp;nbsp; What I noticed is that if I manually interact with turning labels on/off and then run my scripts they work as expected.&amp;nbsp; I know this doesn't help with your automation but if you try toggling visibility manually by toggling on/off and then run your scripts, do you see the refresh?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;P&gt;arcpy.mp team&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Dec 2019 22:44:20 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2019-12-30T22:44:20Z</dc:date>
    <item>
      <title>How to add labels using arcpy</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/how-to-add-labels-using-arcpy/m-p/876995#M226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having problems to show the a Feature Layer label while exporting a Layout to a PDF File&amp;nbsp;using a script tool on ArcGIS Pro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As below, I've set the Label Class and expression, which seems to work on the application; however, when running this script which is producing a Map Book PDF the label for that feature is not shown until the Map Book PDF is exported.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #7a7a7a;"&gt;# Create XY Coordinates Labels
&lt;/SPAN&gt;XYCoordinates.showLabels = &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;True
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;XYCoordinates.supports(&lt;SPAN style="color: #008080;"&gt;"SHOWLABELS"&lt;/SPAN&gt;):
    XYCoordinatesLblClass = XYCoordinates.listLabelClasses()[&lt;SPAN style="color: #267dff;"&gt;0&lt;/SPAN&gt;]
    XYCoordinatesLblClass.expression = &lt;SPAN style="color: #008080;"&gt;"""'&amp;lt;FNT size="24"&amp;gt;' + round($feature.POINT_X) + " " + round($feature.POINT_Y) + '&amp;lt;/FNT&amp;gt;'"""""
&lt;/SPAN&gt;&lt;SPAN style="color: #008080;"&gt;    &lt;/SPAN&gt;XYCoordinatesLblClass.visible = &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is anyone having the same issue? I am also showing the GridIndexFeature labels produced by the Grid Index Features without a problem; so have no ideas as to why this specific one is not being shown until the PDF is produced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 11:00:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/how-to-add-labels-using-arcpy/m-p/876995#M226</guid>
      <dc:creator>AnaVillaran</dc:creator>
      <dc:date>2021-12-12T11:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to add labels using arcpy</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/how-to-add-labels-using-arcpy/m-p/876996#M227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for reporting this.&amp;nbsp; We just addressed this very recently (post 2.5 final).&amp;nbsp; Unfortunately, refresh isn't happening in the UI but you are seeing the correctly results in the export.&amp;nbsp; What I noticed is that if I manually interact with turning labels on/off and then run my scripts they work as expected.&amp;nbsp; I know this doesn't help with your automation but if you try toggling visibility manually by toggling on/off and then run your scripts, do you see the refresh?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;P&gt;arcpy.mp team&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 22:44:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/how-to-add-labels-using-arcpy/m-p/876996#M227</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2019-12-30T22:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to add labels using arcpy</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/how-to-add-labels-using-arcpy/m-p/876997#M228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jeff, what you mentioned is what I ended up doing. Glad to know it has been addressed in 2.5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 17:00:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/how-to-add-labels-using-arcpy/m-p/876997#M228</guid>
      <dc:creator>AnaVillaran</dc:creator>
      <dc:date>2020-06-08T17:00:28Z</dc:date>
    </item>
  </channel>
</rss>

