<?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 Turn on label with arcpy to create script tool in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/turn-on-label-with-arcpy-to-create-script-tool/m-p/1185389#M3871</link>
    <description>&lt;P&gt;Hi! I want to create a script tool that will start the label for certain layers, that is to add the parameters with the layer to which I want to activate the label and what field I want to display it that I need.. I used this script&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;BR /&gt;layer = arcpy.mapping.ListLayers(mxd, "")[0]&lt;BR /&gt;if layer.supports("LABELCLASSES"):&lt;BR /&gt;for lblclass in layer.labelClasses:&lt;BR /&gt;lblclass.showClassLabels = True&lt;BR /&gt;lblclass.expression = " [Layer]"&lt;BR /&gt;layer.showLabels = True&lt;BR /&gt;arcpy.RefreshActiveView()&lt;/P&gt;&lt;P&gt;but it doesn't work to create a script tool, it only works in python windows. Do you have any suggestions?&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2022 08:33:20 GMT</pubDate>
    <dc:creator>AlexandruBârsan</dc:creator>
    <dc:date>2022-06-23T08:33:20Z</dc:date>
    <item>
      <title>Turn on label with arcpy to create script tool</title>
      <link>https://community.esri.com/t5/arcmap-questions/turn-on-label-with-arcpy-to-create-script-tool/m-p/1185389#M3871</link>
      <description>&lt;P&gt;Hi! I want to create a script tool that will start the label for certain layers, that is to add the parameters with the layer to which I want to activate the label and what field I want to display it that I need.. I used this script&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;BR /&gt;layer = arcpy.mapping.ListLayers(mxd, "")[0]&lt;BR /&gt;if layer.supports("LABELCLASSES"):&lt;BR /&gt;for lblclass in layer.labelClasses:&lt;BR /&gt;lblclass.showClassLabels = True&lt;BR /&gt;lblclass.expression = " [Layer]"&lt;BR /&gt;layer.showLabels = True&lt;BR /&gt;arcpy.RefreshActiveView()&lt;/P&gt;&lt;P&gt;but it doesn't work to create a script tool, it only works in python windows. Do you have any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 08:33:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/turn-on-label-with-arcpy-to-create-script-tool/m-p/1185389#M3871</guid>
      <dc:creator>AlexandruBârsan</dc:creator>
      <dc:date>2022-06-23T08:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Turn on label with arcpy to create script tool</title>
      <link>https://community.esri.com/t5/arcmap-questions/turn-on-label-with-arcpy-to-create-script-tool/m-p/1190281#M3883</link>
      <description>&lt;P&gt;You need to read the help file and understand how to turn your script into a script tool. Its all in the help file &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/a-quick-tour-of-creating-tools-in-python.htm" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 09:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/turn-on-label-with-arcpy-to-create-script-tool/m-p/1190281#M3883</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2022-07-07T09:12:39Z</dc:date>
    </item>
  </channel>
</rss>

