2

I have many layers in a aprx file that need to have the path updated. I need to remove part of the string "UTARC." from the datasource path. Through Catalag View on ArcGIS Pro, when I type the new path, a green horizontal bar shows in the left side of the new path. Then when I click on "APPLY" ArcGIS Pro does not change the path! It only works if I go through Properties on the layer and change it manually.

I tried with a Python script and it does not work either. The script runs with no error but no change is made.

aprx = arcpy.mp.ArcGISProject(r"projectpath")
aprx.updateConnectionProperties("UTARC."," ")
aprx.saveACopy(r"projectpath\new.aprx")

1 Answer 1

0

My first thought is that you're not replacing correctly, you're replacing 'UTARC.' with ' ' (a space). I'm guessing you might want this instead:

aprx.updateConnectionProperties("UTARC.","")

That should completely remove 'UTARC.' and not add a space.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.