<?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 Looking for unplaced label information using ArcPy - in the CIM somewhere? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/looking-for-unplaced-label-information-using-arcpy/m-p/1060983#M61221</link>
    <description>&lt;P&gt;I am working on some code for automated map generation, migrating an old script from arcpy.mapping to Python 3 and arcpy.mp.&amp;nbsp; The script creates a map showing 1-n points, each individually labeled.&amp;nbsp; My overall approach is to try to label each point individually and if there are no unplaced labels, then the script will be done.&amp;nbsp; If there are unplaced labels, it will then additional strategies such as key numbering, aggregating labels, etc., checking after each to see if there are no more unplaced labels (or until it reaches the end and tells the user to fix it manually.)&lt;/P&gt;&lt;P&gt;Here's where I'm having trouble: I can't find where to access some kind of indicator (a boolean? a list of unplaced labels?) to tell the script if there are any unplaced labels.&amp;nbsp; I'm trying to avoid a human having to look at the map to provide feedback to the script that there are still unplaced labels (at which point our computer overlords will have won....) Simply forcing it to draw all the labels even when there are conflicts isn't really a solution I can use either.&amp;nbsp; I could dump out a raster then try some kind of cludgy OCR to look for red but there might be other red things on the map, and let's call that an option of last resort.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping it's in the CIM somwehere - this seems like something that &lt;STRONG&gt;should&lt;/STRONG&gt; be in the CIM - and I just haven't found it yet; I've been looking here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/cim-spec/blob/master/docs/v2/CIMLabelPlacement.md" target="_blank"&gt;https://github.com/Esri/cim-spec/blob/master/docs/v2/CIMLabelPlacement.md&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 May 2021 15:16:05 GMT</pubDate>
    <dc:creator>TobiSellekaerts</dc:creator>
    <dc:date>2021-05-24T15:16:05Z</dc:date>
    <item>
      <title>Looking for unplaced label information using ArcPy - in the CIM somewhere?</title>
      <link>https://community.esri.com/t5/python-questions/looking-for-unplaced-label-information-using-arcpy/m-p/1060983#M61221</link>
      <description>&lt;P&gt;I am working on some code for automated map generation, migrating an old script from arcpy.mapping to Python 3 and arcpy.mp.&amp;nbsp; The script creates a map showing 1-n points, each individually labeled.&amp;nbsp; My overall approach is to try to label each point individually and if there are no unplaced labels, then the script will be done.&amp;nbsp; If there are unplaced labels, it will then additional strategies such as key numbering, aggregating labels, etc., checking after each to see if there are no more unplaced labels (or until it reaches the end and tells the user to fix it manually.)&lt;/P&gt;&lt;P&gt;Here's where I'm having trouble: I can't find where to access some kind of indicator (a boolean? a list of unplaced labels?) to tell the script if there are any unplaced labels.&amp;nbsp; I'm trying to avoid a human having to look at the map to provide feedback to the script that there are still unplaced labels (at which point our computer overlords will have won....) Simply forcing it to draw all the labels even when there are conflicts isn't really a solution I can use either.&amp;nbsp; I could dump out a raster then try some kind of cludgy OCR to look for red but there might be other red things on the map, and let's call that an option of last resort.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping it's in the CIM somwehere - this seems like something that &lt;STRONG&gt;should&lt;/STRONG&gt; be in the CIM - and I just haven't found it yet; I've been looking here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/cim-spec/blob/master/docs/v2/CIMLabelPlacement.md" target="_blank"&gt;https://github.com/Esri/cim-spec/blob/master/docs/v2/CIMLabelPlacement.md&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 15:16:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/looking-for-unplaced-label-information-using-arcpy/m-p/1060983#M61221</guid>
      <dc:creator>TobiSellekaerts</dc:creator>
      <dc:date>2021-05-24T15:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for unplaced label information using ArcPy - in the CIM somewhere?</title>
      <link>https://community.esri.com/t5/python-questions/looking-for-unplaced-label-information-using-arcpy/m-p/1062240#M61245</link>
      <description>&lt;P&gt;I've come up with a workaround, in case anyone else has this requirement in the future.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Set up your labeling&lt;/LI&gt;&lt;LI&gt;use arcpy.cartography.ConvertLabelsToAnnotation() to create an annotation table&lt;/LI&gt;&lt;LI&gt;use a cursor on the output table to find any entries where STATUS=1 (which means, unplaced label)&lt;/LI&gt;&lt;LI&gt;If there aren't any records where STATUS=1, you're done.&amp;nbsp; Otherwise:&lt;OL class="lia-list-style-type-lower-alpha"&gt;&lt;LI&gt;Remove the annotation layer from the map&lt;/LI&gt;&lt;LI&gt;Turn back on labeling for all your labeled layers&lt;/LI&gt;&lt;LI&gt;Go back to #1&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 27 May 2021 11:25:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/looking-for-unplaced-label-information-using-arcpy/m-p/1062240#M61245</guid>
      <dc:creator>TobiSellekaerts</dc:creator>
      <dc:date>2021-05-27T11:25:25Z</dc:date>
    </item>
  </channel>
</rss>

