<?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 CIM Path error in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-cim-path-error/m-p/1228953#M61926</link>
    <description>&lt;P&gt;Actually... update needed.&lt;BR /&gt;&lt;BR /&gt;You also need to pull the reference to the layer from your map after you add it.&lt;BR /&gt;So it would be:&lt;BR /&gt;added_lyr = map.addDataFromPath(my_path)&lt;BR /&gt;useful_lyr = map.listLayers(added_lyr.name)[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then use the "useful_lyr" as the input to the Convert to Graphics tool.&lt;BR /&gt;Then add that graphics results to your map.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you use the results from the addDataFromPath tool as the input to Convert to Graphics, instead of grabbing the layer reference from the map, it will do some funky stuff, such as added an extra copy of the graphics to your map, and also not let you edit the text of the graphics label. No clue why.&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2022 22:44:24 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2022-11-04T22:44:24Z</dc:date>
    <item>
      <title>Convert Labels to Graphics CIM Path error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-cim-path-error/m-p/1227698#M61791</link>
      <description>&lt;P&gt;I am trying to add a layer to a map, then convert the labels to graphics. But when I run the script from a custom toolbox script inside the map document it gives me this strange error that I couldn't find any info on:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Invalid CIM dataset for path: CIMPATH=map/ground.json&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scott431_5-1667337842121.png" style="width: 729px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55030i9B5896AE4DDA99CC/image-dimensions/729x248?v=v2" width="729" height="248" role="button" title="Scott431_5-1667337842121.png" alt="Scott431_5-1667337842121.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-1667337299666.png" style="width: 769px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55025i28E947A2B27F05A6/image-dimensions/769x295?v=v2" width="769" height="295" role="button" title="Scott431_1-1667337299666.png" alt="Scott431_1-1667337299666.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When there is another layer in the map document, it is referenced in the bottom of the error instead of "map/ground". I set the Convert to Graphics tool to only work on a "single_layer", so I don't know how other layers could possibly be involved. It's not the main source of the error, but curious none-the-less.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scott431_3-1667337553450.png" style="width: 780px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55027i49081D3D6296B2C8/image-dimensions/780x277?v=v2" width="780" height="277" role="button" title="Scott431_3-1667337553450.png" alt="Scott431_3-1667337553450.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the script as a standalone script it works fine, no other changes necessary!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scott431_2-1667337434219.png" style="width: 730px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55026i512C0B2CFDD9A57C/image-dimensions/730x293?v=v2" width="730" height="293" role="button" title="Scott431_2-1667337434219.png" alt="Scott431_2-1667337434219.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here's another twist. It works when I run it from a custom toolbox script in the map, IF... I add the layer by hand before running the script. And before you suggest it, no, grabbing the layer from map.listLayers() after adding it does not fix the original version of the script. It has to literally be added by hand for this to work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scott431_4-1667337699932.png" style="width: 615px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55029iB00AB893D1A48F71/image-dimensions/615x283?v=v2" width="615" height="283" role="button" title="Scott431_4-1667337699932.png" alt="Scott431_4-1667337699932.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried comparing the object type when I added the layer by hand vs. when I added it through python, and it's exactly the same. I really have no clue what the difference is. But I need to be able to run this through a map document toolbox.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 22:53:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-cim-path-error/m-p/1227698#M61791</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-11-01T22:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Labels to Graphics CIM Path error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-cim-path-error/m-p/1227726#M61797</link>
      <description>&lt;P&gt;I figured out a workaround.&lt;/P&gt;&lt;P&gt;Just use: map.addDataFromPath()&lt;/P&gt;&lt;P&gt;Instead of:&lt;BR /&gt;arcpy.management.MakeFeatureLayer()&lt;BR /&gt;map.addLayer()&lt;BR /&gt;&lt;BR /&gt;Still seems like a glitch, but hey this works...&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 23:17:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-cim-path-error/m-p/1227726#M61797</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-11-01T23:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Labels to Graphics CIM Path error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-cim-path-error/m-p/1228953#M61926</link>
      <description>&lt;P&gt;Actually... update needed.&lt;BR /&gt;&lt;BR /&gt;You also need to pull the reference to the layer from your map after you add it.&lt;BR /&gt;So it would be:&lt;BR /&gt;added_lyr = map.addDataFromPath(my_path)&lt;BR /&gt;useful_lyr = map.listLayers(added_lyr.name)[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then use the "useful_lyr" as the input to the Convert to Graphics tool.&lt;BR /&gt;Then add that graphics results to your map.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you use the results from the addDataFromPath tool as the input to Convert to Graphics, instead of grabbing the layer reference from the map, it will do some funky stuff, such as added an extra copy of the graphics to your map, and also not let you edit the text of the graphics label. No clue why.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 22:44:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-labels-to-graphics-cim-path-error/m-p/1228953#M61926</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-11-04T22:44:24Z</dc:date>
    </item>
  </channel>
</rss>

