<?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: Convert labels to graphics broken with Python? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226433#M61668</link>
    <description>&lt;P&gt;Replace your call to the "SaveToLayerFile" function with "m.addLayer(graphics)". The former is implicitly adding the new layer to the active map while Pro is open but that's not how GP tools work outside of Pro, so you need to explicitly add the layer through the Map object's method. If that doesn't work, try extracting the specific graphics layer result with "graphics = graphics[0]" first, sometimes full result objects act a bit odd.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2022 22:05:13 GMT</pubDate>
    <dc:creator>DavidSolari</dc:creator>
    <dc:date>2022-10-27T22:05:13Z</dc:date>
    <item>
      <title>Convert labels to graphics broken with Python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226372#M61658</link>
      <description>&lt;P&gt;I am trying to run a python script that will convert labels to graphics. However, it does not work when the script is run from a&amp;nbsp;separate python script, or as a toolbox script. It only works when run from the python window inside ArcGIS Pro. I tried the exact same commands, so I know it's not a typo (obviously changed where necessary to refer to the "current" map instead of a path, etc).&lt;/P&gt;&lt;P&gt;The stand alone script / toolbox scripts dont' give any errors, they just doesn't add the graphics layer to the map. Furthermore, when I try to save the output from Convert to Graphics tool to a layer file it creates a bad file. Again, it doesn't throw any errors, the file just doesn't work when I try to load it into a map. When I opened the .lyrx file a text editor you can see the CIM info is mostly nonexistent.&lt;/P&gt;&lt;P&gt;Tell me I'm not the only one!&lt;/P&gt;&lt;P&gt;(Using Pro 2.9)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scott431_0-1666901648985.png" style="width: 597px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54660iEAB89A570F80AC51/image-dimensions/597x351?v=v2" width="597" height="351" role="button" title="Scott431_0-1666901648985.png" alt="Scott431_0-1666901648985.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scott431_1-1666901667942.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54661iD50EF62574485725/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Scott431_1-1666901667942.png" alt="Scott431_1-1666901667942.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 20:14:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226372#M61658</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-10-27T20:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert labels to graphics broken with Python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226417#M61667</link>
      <description>&lt;P&gt;Try dropping&amp;nbsp;&lt;/P&gt;&lt;P&gt;graphics =&lt;/P&gt;&lt;P&gt;from the cartography construction line.&amp;nbsp; The tool doesn't return anything and the variable graphics (which would equal None) may be obscuring the 'graphics' in the tool&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 21:28:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226417#M61667</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-10-27T21:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convert labels to graphics broken with Python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226433#M61668</link>
      <description>&lt;P&gt;Replace your call to the "SaveToLayerFile" function with "m.addLayer(graphics)". The former is implicitly adding the new layer to the active map while Pro is open but that's not how GP tools work outside of Pro, so you need to explicitly add the layer through the Map object's method. If that doesn't work, try extracting the specific graphics layer result with "graphics = graphics[0]" first, sometimes full result objects act a bit odd.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 22:05:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226433#M61668</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2022-10-27T22:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Convert labels to graphics broken with Python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226436#M61669</link>
      <description>&lt;P&gt;I already tried that and it doesn't help. The tool actually does return a graphics layer object that can be referenced as a variable. Screenshot below I returned info about the results object. I get the exact same arcpy.da.Describe info when I successfully run the code in the ArcPro Python window, as when I run it as a standalone script and it doesn't work.&lt;BR /&gt;&lt;BR /&gt;Not sure if that's useful for troubleshooting. Probably more confounding than anything.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scott431_0-1666908383778.png" style="width: 551px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54672i4A29154E004E9945/image-dimensions/551x248?v=v2" width="551" height="248" role="button" title="Scott431_0-1666908383778.png" alt="Scott431_0-1666908383778.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 22:08:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226436#M61669</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-10-27T22:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Convert labels to graphics broken with Python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226437#M61670</link>
      <description>&lt;P&gt;Success!!!! I had tried that already, but I did "graphics" instead of "graphics[0]". Adding the [0] index made all the difference, thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 22:12:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226437#M61670</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-10-27T22:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Convert labels to graphics broken with Python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226439#M61671</link>
      <description>&lt;P&gt;I guess it makes sense considering the types returned...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scott431_0-1666909056034.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54673i8C99B186EAE1C16F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Scott431_0-1666909056034.png" alt="Scott431_0-1666909056034.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 22:17:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-broken-with-python/m-p/1226439#M61671</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-10-27T22:17:41Z</dc:date>
    </item>
  </channel>
</rss>

