<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Add Feature Class to MXD in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/add-feature-class-to-mxd/m-p/371658#M29390</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, Marcin. You had the step I was missing to automate it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jul 2012 15:27:45 GMT</pubDate>
    <dc:creator>BondHarper</dc:creator>
    <dc:date>2012-07-05T15:27:45Z</dc:date>
    <item>
      <title>Add Feature Class to MXD</title>
      <link>https://community.esri.com/t5/python-questions/add-feature-class-to-mxd/m-p/371656#M29388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all. I have feature classes in numerous geodatabases that I want to add to some MXDs using a script. I can set up the loop, but for some reason I can't find how to add a feature class to a MXD using Python. It seems like it should be simple, so maybe I am overlooking something. (I found how to add a layer, but I don't have .lyr files)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 21:21:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-feature-class-to-mxd/m-p/371656#M29388</guid>
      <dc:creator>BondHarper</dc:creator>
      <dc:date>2012-06-19T21:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Add Feature Class to MXD</title>
      <link>https://community.esri.com/t5/python-questions/add-feature-class-to-mxd/m-p/371657#M29389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You have to make feature layer from your feature class first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's an example (feature layer 'Roads' should be added to first data frame of map document):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy inFC = r"C:\tmp\Test_CopyAttr.gdb\RoadsFC" arcpy.MakeFeatureLayer_management(inFC, "Roads")&amp;nbsp; mxd = arcpy.mapping.MapDocument(r"C:\tmp\MapProjects\Untitled1.mxd") df = arcpy.mapping.ListDataFrames(mxd)[0] lyrLayer = arcpy.mapping.Layer("Roads") arcpy.mapping.AddLayer(df, lyrLayer, "AUTO_ARRANGE") mxd.save()&amp;nbsp; del mxd&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 04:33:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-feature-class-to-mxd/m-p/371657#M29389</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2012-06-20T04:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add Feature Class to MXD</title>
      <link>https://community.esri.com/t5/python-questions/add-feature-class-to-mxd/m-p/371658#M29390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, Marcin. You had the step I was missing to automate it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2012 15:27:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-feature-class-to-mxd/m-p/371658#M29390</guid>
      <dc:creator>BondHarper</dc:creator>
      <dc:date>2012-07-05T15:27:45Z</dc:date>
    </item>
  </channel>
</rss>

