AnsweredAssumed Answered

Can the layer name in the TOC be updated using arcpy?

Question asked by rastrauch Champion on Aug 19, 2015
Latest reply on Aug 19, 2015 by iamurray

I'm working on a script to update all my broken links in my mxd's do to server and folder changes.  Some of these changes are from one data type to another. I'm working my way thru the various combinations, and now working on an old SDE to FGDB.  Unfortunately the name in my Table of Contents is still called the default SDE connection name (e.g. SDE_COMMON.SDEWILD.NED_HILLSHADECLIP).  I would like to rename this in the TOC to just NED_HILLSHAPECLIP in this case.

 

In short, I need to replace my   "lyr.name"  with   "lyr.datasetName"

 

Is there a way to do this in python?

 

I am trying to keep my script/tools 10.2.2 compatible.

 

Thanks.

Outcomes