I've been working on a geoprocessing script that will use the Match Symbology to A Style Tool. Unfortunatley every time the script reaches the line where I call the tool, Pro crashes.
Interestingly, if I use the same line of code in the python window it works correctly. Anyone else run into this issue before?
Here is the code up to that point:
import arcpy
'''Set Parameters'''
map_name = arcpy.GetParameterAsText(0)
retail_layer = arcpy.GetParameterAsText(1)
symbol_param = arcpy.GetParameterAsText(2)
label_opt = arcpy.GetParameterAsText(3)
p = arcpy.mp.ArcGISProject('CURRENT')
m = p.listMaps(map_name)[0]
lyr = m.listLayers(retail_layer)[0]
rows = arcpy.SearchCursor(lyr)
names = [row.Name for row in rows]
'''Update the layer to unique values by name''
arcpy.management.MatchLayerSymbologyToAStyle(lyr, "$feature.ChainName", r"C:\Desktop\Logos.stylx")