I am adding map layers in an arcpy script within arcgis pro 1.4. The layer is added to the legend, but how can I then format the legend items in the arcpy script? I could do this in arcpy for arcmap using the mapping module, but that isn't available in arcgis pro?! Is there another way?
More concrete, how can I translate the script below to something that works in arcpy for acrgis pro:
styleItem = arcpy.mapping.ListStyleItems("USER_STYLE", "Legend Items", "NewDefaultLegendStyle")[0]lyr = arcpy.mapping.ListLayers(mxd, 'Rivers', df)[0]legend = arcpy.mapping.ListLayoutElements(mxd, "LEGEND_ELEMENT")[0]legend.updateItem(lyr, styleItem)
A quick note... arcpy.mapping in arcmap is now arcpy.ma in PRO have a look at the object model, but it may be as simple as changing mapping to ma
mapping is changed to mp, right? That is also where the link is forwarding to. Just changing mapping into mp is not working. It seems to be a differently set up module. Any other suggestions?
It is a matter of browsing around, but there is a diagram on this link that may help with navigation, since things have 'moved around' as they indicate