I am trying to add a layer to my current map with this script using a script tool, however whenever I run the script tool it says addLayer failed.
What in my script can be fixed to get addLayer to work?
Solved! Go to Solution.
Add layer takes a layer object and you appear to be feeding it a file path.
Create a layer ( should be arcpy.mp.Layer(), I think) then feed that into addlayer() instead
https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm
Add layer takes a layer object and you appear to be feeding it a file path.
Create a layer ( should be arcpy.mp.Layer(), I think) then feed that into addlayer() instead
https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm
That worked, thank you!