<?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 Error with Annotate Selected Features in ArcGIS Pro 2.1.2 in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-annotate-selected-features-in-arcgis/m-p/791414#M1605</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying complete a script that will automatically create an annotation layer from a feature layer in ArcGIS Pro but am hitting a wall with the "Annotate Selected Features" code block (all information is on the &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/cartography/annotate-selected-features.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;ESRI site here&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy 
import os 
import os.path 
import sys 
import datetime&amp;nbsp;
 
arcpy.env.workspace = r"C:\Users\myname\Desktop\USACE\Working_Map\Working_map.gdb"&amp;nbsp; 
aprx = arcpy.mp.ArcGISProject(r"C:\Users\myname\Desktop\USACE\Working_Map\Working_Map.aprx")&amp;nbsp; 
m = aprx.listMaps("Map")[0]&amp;nbsp; 
lyr = m.listLayers("WGRES_Layer")[0]&amp;nbsp; 

arcpy.AnnotateSelectedFeatures_cartography(m, 'WGRES_Layer', "WGRES_LayerAnno 'Class 1'", 'GENERATE_UNPLACED')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now the weirdest thing is the error message I get when I try to run this block; I get the message:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Traceback (most recent call last):
&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 15, in &amp;lt;module&amp;gt; 
AttributeError: module 'arcpy' has no attribute 'AnnotateSelectedFeatures_cartography'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Does anyone have any idea what's going on? I get the same thing if I tried to run the tool as "AnnotateSelectedFeatures" instead (i.e. remove "_cartography" from the end).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have any clue, please feel free to contact me; I'm really banging my head against a wall here!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:55:18 GMT</pubDate>
    <dc:creator>MaxReis</dc:creator>
    <dc:date>2021-12-12T16:55:18Z</dc:date>
    <item>
      <title>Error with Annotate Selected Features in ArcGIS Pro 2.1.2</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-annotate-selected-features-in-arcgis/m-p/791414#M1605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying complete a script that will automatically create an annotation layer from a feature layer in ArcGIS Pro but am hitting a wall with the "Annotate Selected Features" code block (all information is on the &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/cartography/annotate-selected-features.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;ESRI site here&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy 
import os 
import os.path 
import sys 
import datetime&amp;nbsp;
 
arcpy.env.workspace = r"C:\Users\myname\Desktop\USACE\Working_Map\Working_map.gdb"&amp;nbsp; 
aprx = arcpy.mp.ArcGISProject(r"C:\Users\myname\Desktop\USACE\Working_Map\Working_Map.aprx")&amp;nbsp; 
m = aprx.listMaps("Map")[0]&amp;nbsp; 
lyr = m.listLayers("WGRES_Layer")[0]&amp;nbsp; 

arcpy.AnnotateSelectedFeatures_cartography(m, 'WGRES_Layer', "WGRES_LayerAnno 'Class 1'", 'GENERATE_UNPLACED')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now the weirdest thing is the error message I get when I try to run this block; I get the message:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Traceback (most recent call last):
&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 15, in &amp;lt;module&amp;gt; 
AttributeError: module 'arcpy' has no attribute 'AnnotateSelectedFeatures_cartography'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Does anyone have any idea what's going on? I get the same thing if I tried to run the tool as "AnnotateSelectedFeatures" instead (i.e. remove "_cartography" from the end).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have any clue, please feel free to contact me; I'm really banging my head against a wall here!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:55:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-annotate-selected-features-in-arcgis/m-p/791414#M1605</guid>
      <dc:creator>MaxReis</dc:creator>
      <dc:date>2021-12-12T16:55:18Z</dc:date>
    </item>
  </channel>
</rss>

