I have an ArcGIS Pro Project containing layers that have shapefiles as sources. I wrote a script using ArcPy to convert this data to File Geodatabases. Everything works fine here without any issues.
The next step I want to take is replace the data sources of the same layers that I exported, so that they will be referencing the new file location in the File GDB. The best (and only?) way to replace the data source and dataset name is to use Layer.replaceDataSource . But when I use this Layer method, I get this error:
AttributeError: 'Layer' object has no attribute 'replaceDataSource'
This is because replaceDataSource is a method found only in arcpy.mapping's Layer class. In other words, I'd need to use an ArcMap map document to utilize this method, instead of Pro. Is there a way to do this using arcpy.mp library? Are there any other ways to achieve what I'm trying to do in ArcGIS Pro with ArcPy?
Thank you for the help!
Solved! Go to Solution.
apparently not right enough