Select to view content in your preferred language

using maplex and arcpy.mapping?

3444
3
10-03-2012 10:07 AM
JoshuaChan
Deactivated User
Does maplex work when using your mxd via arcpy.mapping?

I saved my mxd with Maplex turned on. I ran my script but the labelling doesn't look right - many of my polygons remain unlabelled. I checked ON the box that says "Never remove labels" and I set the minimum feature size for labelling to be 1 millimetre

any one have similar experience with a work around ?

thx
0 Kudos
3 Replies
JohnSobetzer
Honored Contributor
I've had it work fine in several of my 10.1 DDP projects exported to geotiff using some arcpy code, and these have had some pretty complex labels in large layers.  There are a lot of maplex settings you might play around with in the placement properties for a layer and within the label weight and priority settings of maplex generally.  Some improve your ability to place a label, but some also would keep a label from being placed.  It might be worth it to just set aside some time and manipulate different settings to see what happens.    The Best setting not surprisingly works best but it is slower.  If you have a lot of complex label expressions, and/or multiple classes and definition queries for them, and/or label feature weights or placement options,you can overwhelm maplex.   You might also use the options to show unplaced labels in a color (default red).
0 Kudos
JoshuaChan
Deactivated User
i've tried quite a few settings including feature weights, label sizes, label locations etc. I tried showing the unplaced labels but nothing appeared. So far, my only solution is to revert to the generic ESRI labelling. It's ugly but at least I can force it to label everything.




I've had it work fine in several of my 10.1 DDP projects exported to geotiff using some arcpy code, and these have had some pretty complex labels in large layers.  There are a lot of maplex settings you might play around with in the placement properties for a layer and within the label weight and priority settings of maplex generally.  Some improve your ability to place a label, but some also would keep a label from being placed.  It might be worth it to just set aside some time and manipulate different settings to see what happens.    The Best setting not surprisingly works best but it is slower.  If you have a lot of complex label expressions, and/or multiple classes and definition queries for them, and/or label feature weights or placement options,you can overwhelm maplex.   You might also use the options to show unplaced labels in a color (default red).
0 Kudos
JeffBarrette
Esri Regular Contributor
Are you saying that if you physically open an MXD in ArcMap, look at the layout, export to PDF, all is well.  But if you connect to an mxd via arcpy.mapping and export to PDF, you don't get the same results?

import arcpy
mxd = arcpy.mapping.MapDocument(path to mxd)
arcpy.mapping.ExportToPDF(mxd, path to pdf)
del mxd


It would be nice to see your output PDFs.

Jeff
0 Kudos