AnsweredAssumed Answered

Legends in arcpy for arcgis pro 1.4

Question asked by m.dekeizer@argusi.org on Feb 14, 2017
Latest reply on Feb 14, 2017 by Dan_Patterson

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)

Outcomes