I am trying to update a geoprocessing service that was in ArcMap to ArcGIS Pro. The geoprocessing services use a style file for its legend and I want to update certain legends but I have no idea how. Here is the snippet of the code that I am using.

    lyr = mapframe.listLayers(droughtLayerName)
    styleItem = arcpy.mapping.ListStyleItems(stylePath,"Legend Items")[0]

enter image description here

  • You're going to have to provide a lot more information than this. ArcMap didn't have arcpy.mp, so you've already updated away from arcpy.mapping, but where are you stuck? Porting the code? using the style file? What's the result of the code you've provided
    – KHibma
    Nov 16, 2022 at 15:33
  • In arc.mp I could not find the library named ListStyleItems. Nov 16, 2022 at 16:36
  • @KHibma I am stuck because I cannot figure out a way to read the Style file in Arcpro 3 using arcpy. Nov 16, 2022 at 16:38


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.