Skip to main content
1 of 5
GIS_GOD
  • 399
  • 1
  • 13

Source a Layer in TOC to a New Feature Class

I'm trying to source a layer in my TOC with a new feature class. I've read countless forums, ArcGIS Resource Center, etc. With the MXD and python window open this is what I've surmised so far.

import arcpy

mxd = arcpy.mapping.MapDocumnet("CURRENT")

Using the following link, which scenario matches what I want to do most accurately?

MXD Source = r'\na\data\telecom\projects\GIS\Proposal_Kentucky_Nextgen\02GISData\18DDP_ENG\MXDS\ENCHROACHMENT MXD\0180.SA - C001-C010 - 1.0 - PE.mxd

MXD Name = 0180.SA - C001-C010 - 1.0 - PE.mxd

Layer Name in TOC = STRUCTURE_SITEID_180

Layer in TOC's path = \na\data\telecom\projects\GIS\Proposal_Kentucky_Nextgen\02GISData\18DDP_ENG\Design_Data.gdb\STRUCTURE_SITEID_180

Feature Class I Want to Source to Name = STRUCTURE_SITEID_211

Feature Class I Want to Source to File Path (same as the layer I'm trying to resource) = \na\data\telecom\projects\GIS\Proposal_Kentucky_Nextgen\02GISData\18DDP_ENG\Design_Data.gdb\STRUCTURE_SITEID_211

How do I finish the Python script to accomplish the task? If I can get one to work I can extrapolate. I'm using ArcMap 10.3.1.

GIS_GOD
  • 399
  • 1
  • 13