I am working on some code for automated map generation, migrating an old script from arcpy.mapping to Python 3 and arcpy.mp. The script creates a map showing 1-n points, each individually labeled. My overall approach is to try to label each point individually and if there are no unplaced labels, then the script will be done. 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.)
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. 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. 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.
I'm hoping it's in the CIM somwehere - this seems like something that should be in the CIM - and I just haven't found it yet; I've been looking here:
https://github.com/Esri/cim-spec/blob/master/docs/v2/CIMLabelPlacement.md
Solved! Go to Solution.
I've come up with a workaround, in case anyone else has this requirement in the future.
I've come up with a workaround, in case anyone else has this requirement in the future.