<?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 How can we change the label to Annotation for point layer through Arcpy(Python)? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224025#M17310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to convert the label for a point layer to annotation. Below is my script and the error I am getting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;import arcpy.mapping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# Set environment settings&lt;/STRONG&gt;&lt;BR /&gt;env.workspace = "C:\Users\Documents"&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#define projection&lt;/STRONG&gt;&lt;BR /&gt;Prjfile = r"C:\\Users\\Documents\\WGS1984.prj"&lt;BR /&gt;spRef = arcpy.SpatialReference(Prjfile)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#Local Variables&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FC7 = r"C:\Users\Documents\South.gdb\Search_Ring"&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument(r"C:\Users\Documents\Demo_South.mxd")&lt;BR /&gt;df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Convert Feature class to feature layer&lt;/STRONG&gt;&lt;BR /&gt;arcpy.MakeFeatureLayer_management(FC7, r"C:\Users\Documents\Search_Ring.lyr")&lt;/P&gt;&lt;P&gt;layer7 = arcpy.mapping.Layer(r"C:\Users\Documents\Search_Ring.lyr")&lt;BR /&gt;Sym_layer7 = r"C:\Users\Documents\Search Ring.lyr"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Apply symbology and add layer to MXD&lt;/STRONG&gt;&lt;BR /&gt;arcpy.ApplySymbologyFromLayer_management (layer7, Sym_layer7)&lt;BR /&gt;arcpy.mapping.AddLayer(df, layer7, "TOP")&lt;BR /&gt;lyr7 = arcpy.mapping.ListLayers(mxd, "", df)[0]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Add the labels and its format&lt;/STRONG&gt;&lt;BR /&gt;lyr7.labelClasses[0].expression = '"{}" + [Candidate_Code] + "{}"'.format("&amp;lt;CLR blue='255'&amp;gt;&amp;lt;FNT size = '9'&amp;gt;&amp;lt;BOL&amp;gt;", "&amp;lt;/BOL&amp;gt;&amp;lt;/FNT&amp;gt;&amp;lt;/CLR&amp;gt;")&lt;BR /&gt;lyr7.showLabels = True&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Convert label to Annotation&lt;/STRONG&gt;&lt;BR /&gt;arcpy.ConvertLabelsToAnnotation_defense (mxd, "")&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Add Layer Properties&lt;/STRONG&gt;&lt;BR /&gt;lyr7.visible = False&lt;BR /&gt;lyr7.name = "Search_Ring"&lt;BR /&gt;lyr7.maxScale = 0;&lt;BR /&gt;lyr7.minScale = 5000000;&lt;BR /&gt;lyr7.transparency = 25;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;arcpy.RefreshActiveView()&lt;BR /&gt;arcpy.RefreshTOC()&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Save the mxd&lt;/STRONG&gt;&lt;BR /&gt;mxd.saveACopy(r"C:\Users\Documents\South.mxd")&lt;/P&gt;&lt;P&gt;del mxd,df&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ERROR:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="243939" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/243939_pastedImage_11.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #4d4d4d; background-color: #ffffff; border: 0px; font-size: 12px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Oct 2016 14:54:03 GMT</pubDate>
    <dc:creator>ManjariGoyal</dc:creator>
    <dc:date>2016-10-12T14:54:03Z</dc:date>
    <item>
      <title>How can we change the label to Annotation for point layer through Arcpy(Python)?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224025#M17310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to convert the label for a point layer to annotation. Below is my script and the error I am getting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;import arcpy.mapping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# Set environment settings&lt;/STRONG&gt;&lt;BR /&gt;env.workspace = "C:\Users\Documents"&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#define projection&lt;/STRONG&gt;&lt;BR /&gt;Prjfile = r"C:\\Users\\Documents\\WGS1984.prj"&lt;BR /&gt;spRef = arcpy.SpatialReference(Prjfile)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#Local Variables&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FC7 = r"C:\Users\Documents\South.gdb\Search_Ring"&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument(r"C:\Users\Documents\Demo_South.mxd")&lt;BR /&gt;df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Convert Feature class to feature layer&lt;/STRONG&gt;&lt;BR /&gt;arcpy.MakeFeatureLayer_management(FC7, r"C:\Users\Documents\Search_Ring.lyr")&lt;/P&gt;&lt;P&gt;layer7 = arcpy.mapping.Layer(r"C:\Users\Documents\Search_Ring.lyr")&lt;BR /&gt;Sym_layer7 = r"C:\Users\Documents\Search Ring.lyr"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Apply symbology and add layer to MXD&lt;/STRONG&gt;&lt;BR /&gt;arcpy.ApplySymbologyFromLayer_management (layer7, Sym_layer7)&lt;BR /&gt;arcpy.mapping.AddLayer(df, layer7, "TOP")&lt;BR /&gt;lyr7 = arcpy.mapping.ListLayers(mxd, "", df)[0]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Add the labels and its format&lt;/STRONG&gt;&lt;BR /&gt;lyr7.labelClasses[0].expression = '"{}" + [Candidate_Code] + "{}"'.format("&amp;lt;CLR blue='255'&amp;gt;&amp;lt;FNT size = '9'&amp;gt;&amp;lt;BOL&amp;gt;", "&amp;lt;/BOL&amp;gt;&amp;lt;/FNT&amp;gt;&amp;lt;/CLR&amp;gt;")&lt;BR /&gt;lyr7.showLabels = True&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Convert label to Annotation&lt;/STRONG&gt;&lt;BR /&gt;arcpy.ConvertLabelsToAnnotation_defense (mxd, "")&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Add Layer Properties&lt;/STRONG&gt;&lt;BR /&gt;lyr7.visible = False&lt;BR /&gt;lyr7.name = "Search_Ring"&lt;BR /&gt;lyr7.maxScale = 0;&lt;BR /&gt;lyr7.minScale = 5000000;&lt;BR /&gt;lyr7.transparency = 25;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;arcpy.RefreshActiveView()&lt;BR /&gt;arcpy.RefreshTOC()&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Save the mxd&lt;/STRONG&gt;&lt;BR /&gt;mxd.saveACopy(r"C:\Users\Documents\South.mxd")&lt;/P&gt;&lt;P&gt;del mxd,df&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ERROR:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="243939" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/243939_pastedImage_11.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #4d4d4d; background-color: #ffffff; border: 0px; font-size: 12px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 14:54:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224025#M17310</guid>
      <dc:creator>ManjariGoyal</dc:creator>
      <dc:date>2016-10-12T14:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can we change the label to Annotation for point layer through Arcpy(Python)?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224026#M17311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have you enabled the extension?&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/defense-mapping-toolbox/convert-labels-to-annotation.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/defense-mapping-toolbox/convert-labels-to-annotation.htm"&gt;Convert Labels To Annotation—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 14:58:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224026#M17311</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-10-12T14:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can we change the label to Annotation for point layer through Arcpy(Python)?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224027#M17312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems like I don't have this defense mapping extension. Is there any other way to do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 15:21:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224027#M17312</guid>
      <dc:creator>ManjariGoyal</dc:creator>
      <dc:date>2016-10-12T15:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can we change the label to Annotation for point layer through Arcpy(Python)?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224028#M17313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;close&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/manage-data/annotations/converting-labels-to-annotation-features.htm" title="http://desktop.arcgis.com/en/arcmap/latest/manage-data/annotations/converting-labels-to-annotation-features.htm"&gt;Converting labels to annotation features—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or manually using this&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/map/working-with-text/converting-labels-to-annotation.htm" title="http://desktop.arcgis.com/en/arcmap/latest/map/working-with-text/converting-labels-to-annotation.htm"&gt;Converting labels to annotation—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't use them but the only other references are to lessons or the military analyst&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 15:42:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224028#M17313</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-10-12T15:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can we change the label to Annotation for point layer through Arcpy(Python)?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224029#M17314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another tool to explore&amp;nbsp;is &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/cartography-toolbox/tiled-labels-to-annotation.htm"&gt;Tiled Labels To Annotation&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 15:47:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-we-change-the-label-to-annotation-for/m-p/224029#M17314</guid>
      <dc:creator>BrittneyWhite1</dc:creator>
      <dc:date>2016-10-12T15:47:58Z</dc:date>
    </item>
  </channel>
</rss>

