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:
<SPAN class="">styleItem</SPAN> <SPAN class="">=</SPAN> <SPAN class="">arcpy</SPAN><SPAN class="">.</SPAN><SPAN class="">mapping</SPAN><SPAN class="">.</SPAN><SPAN class="">ListStyleItems</SPAN><SPAN class="">(</SPAN><SPAN class="">"USER_STYLE"</SPAN><SPAN class="">,</SPAN> <SPAN class="">"Legend Items"</SPAN><SPAN class="">,</SPAN> <SPAN class="">"NewDefaultLegendStyle"</SPAN><SPAN class="">)[</SPAN><SPAN class="">0</SPAN><SPAN class="">]</SPAN><SPAN class="">lyr</SPAN> <SPAN class="">=</SPAN> <SPAN class="">arcpy</SPAN><SPAN class="">.</SPAN><SPAN class="">mapping</SPAN><SPAN class="">.</SPAN><SPAN class="">ListLayers</SPAN><SPAN class="">(</SPAN><SPAN class="">mxd</SPAN><SPAN class="">,</SPAN> <SPAN class="">'Rivers'</SPAN><SPAN class="">,</SPAN> <SPAN class="">df</SPAN><SPAN class="">)[</SPAN><SPAN class="">0</SPAN><SPAN class="">]</SPAN><SPAN class="">legend</SPAN> <SPAN class="">=</SPAN> <SPAN class="">arcpy</SPAN><SPAN class="">.</SPAN><SPAN class="">mapping</SPAN><SPAN class="">.</SPAN><SPAN class="">ListLayoutElements</SPAN><SPAN class="">(</SPAN><SPAN class="">mxd</SPAN><SPAN class="">,</SPAN> <SPAN class="">"LEGEND_ELEMENT"</SPAN><SPAN class="">)[</SPAN><SPAN class="">0</SPAN><SPAN class="">]</SPAN><SPAN class="">legend</SPAN><SPAN class="">.</SPAN><SPAN class="">updateItem</SPAN><SPAN class="">(</SPAN><SPAN class="">lyr</SPAN><SPAN class="">,</SPAN> <SPAN class="">styleItem</SPAN><SPAN class="">)</SPAN>