Hello,
I am attempting to write a map automation script for ArcGIS Pro. Taking things one step at a time, and so far the script successfully creates some layers, adds them to a specified geodatabase, and then adds them to the current map in the Pro project. I then need to apply symbology to the layers, which I am trying to do using arcpy.ApplySymbologyFromLayer_management. Here is a snippet from my code:
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps("Primary Map Frame")[0]
m.addDataFromPath(f"{out_gdb}\BackgroundPointsFiltered_{dateTag}")
m.addDataFromPath(f"{out_gdb}\CompliancePointsFiltered_{dateTag}")
m.addDataFromPath(f"{out_gdb}\WorkLocationPointsFiltered_{dateTag}")
in_layer = m.listLayers()[2] # The background points layer that was just added to the map frame
in_symbology_layer = r"R:\gis\.....BackgroundPointsFiltered.lyrx"
arcpy.ApplySymbologyFromLayer_management(in_layer, in_symbology_layer)
I've tried many other variations that I've seen from hints on stackexchange and geonet, but none have seemed to work for me. The script doesn't fail, but the symbology doesn't update.
What am I doing wrong here? Or is this somehow still related to a bug that I've seen mentioned related to this tool?
I'm using ArcGIS Pro v3.0.2