<?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 data to existing layer file in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724043#M56055</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Arek, thanks for responding. If I wanted to manually add data to a .lyr file, I would go into ArcCatalog, right mouse click my .lyr file, then go "properties" -&amp;gt; "add", then select the data a want to add. I want to do the same thing except using python script (I have&amp;nbsp; approx 200 .lyr files I want to add data too).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, D&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Jan 2013 22:37:57 GMT</pubDate>
    <dc:creator>DamianMilne</dc:creator>
    <dc:date>2013-01-09T22:37:57Z</dc:date>
    <item>
      <title>Add data to existing layer file</title>
      <link>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724041#M56053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, I thought this would be simple (perhaps it is)...how do I add additional data layers to an existing layer (.lyr) file using python?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, Damian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 05:15:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724041#M56053</guid>
      <dc:creator>DamianMilne</dc:creator>
      <dc:date>2013-01-09T05:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add data to existing layer file</title>
      <link>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724042#M56054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What does "add additional data layers to an existing layer (.lyr)" stands for? You want to chage featureclass, definition query, addaditional data to GroupLayer lyr, or what?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 08:49:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724042#M56054</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2013-01-09T08:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Add data to existing layer file</title>
      <link>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724043#M56055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Arek, thanks for responding. If I wanted to manually add data to a .lyr file, I would go into ArcCatalog, right mouse click my .lyr file, then go "properties" -&amp;gt; "add", then select the data a want to add. I want to do the same thing except using python script (I have&amp;nbsp; approx 200 .lyr files I want to add data too).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, D&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 22:37:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724043#M56055</guid>
      <dc:creator>DamianMilne</dc:creator>
      <dc:date>2013-01-09T22:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Add data to existing layer file</title>
      <link>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724044#M56056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, now i know what you trying to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure this is the easiest way, but got no better idea.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My proposition is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Create empty mxd file. - this is manual part - one mxd is enough.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Loop for each lyr:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 2) Add lyr file to data frame in this mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 3) Read name of grouplayer from ListLayer in mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 4) Use AddLayerToGroup with data you want to use and group name read in previous point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 5) Save layer from mxd to lyr (function save() or saveACopy() on layer object from mxd).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 6) Remove all layers from mxd&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That's only idea I have. Maybe someone know easiest way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 12:22:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724044#M56056</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2013-01-10T12:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add data to existing layer file</title>
      <link>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724045#M56057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Arek, I suspected there wasn't anyway to edit a .lyr file directly. Of well, I guess it's only a few extra lines of python code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, D&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 21:12:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724045#M56057</guid>
      <dc:creator>DamianMilne</dc:creator>
      <dc:date>2013-01-10T21:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add data to existing layer file</title>
      <link>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724046#M56058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just to add to the answer, use InsertLayer if you need additional control on exactly where to add the layer - the AddLayerToGroup only provides TOP and BOTTOM additional user-specified params (AUTO_ARRANGE is the default)...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, you may ask, why 2 commands that do almost the same thing?&amp;nbsp; InsertLayer cannot add to an empty Data Frame or group layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;InsertLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resource Center » Professional Library » Geoprocessing » The ArcPy site package » Mapping module » Functions » Managing Documents and Layers&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000000z000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000000z000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jan 2013 15:35:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-data-to-existing-layer-file/m-p/724046#M56058</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-13T15:35:35Z</dc:date>
    </item>
  </channel>
</rss>

