I am automating Map production and need to format the legend for the new layers that I add. In ArcMap it seemed possible. But from the documentation in https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/legenditem-class.htm , it looks like there is no option to choose if to show layer name or headings?
Solved! Go to Solution.
I found it, you have to work with CIM objects and the solution is included in the script Legend_LegendItemsAndPatch.py in the CIM samples on https://www.arcgis.com/home/item.html?id=8772f61319584882bb697ba003030636
An additional question would be, how I change the label for the Headings if I e.g. use graduated colors for vector data with arcpy?
I found it, you have to work with CIM objects and the solution is included in the script Legend_LegendItemsAndPatch.py in the CIM samples on https://www.arcgis.com/home/item.html?id=8772f61319584882bb697ba003030636