<?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: Import lyr file to entire project in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/import-lyr-file-to-entire-project/m-p/702492#M54440</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;BR /&gt;&lt;SPAN&gt;Thanks for the code but I think I didn�??t explain myself very well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What I meant was importing a raster symbology lyr file. I have about 200 rasters that I made using model builder and I need to uniform all classification intervals. When I use the model builder to produce rasters from kriging they always come out&amp;nbsp; in the form of stretched&amp;nbsp; with values differing in each raster, which usually I have to import the symbology lyr file one by one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So what I�??m looking for is a way, which I think only code will solve, to make possible importing the symbology (lyr) file to the rest of the rasters in the project, or a group layer giving them all the same classification values making them more comparable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any help&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Patrao&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Apr 2011 09:17:41 GMT</pubDate>
    <dc:creator>PatrãoPedro</dc:creator>
    <dc:date>2011-04-11T09:17:41Z</dc:date>
    <item>
      <title>Import lyr file to entire project</title>
      <link>https://community.esri.com/t5/python-questions/import-lyr-file-to-entire-project/m-p/702490#M54438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello to all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have or can point me in the right direction were to find a piece of code that allow's you to import a lyr file to an entire project or to a defined group layer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Patrao&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 09:27:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-lyr-file-to-entire-project/m-p/702490#M54438</guid>
      <dc:creator>PatrãoPedro</dc:creator>
      <dc:date>2011-04-08T09:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Import lyr file to entire project</title>
      <link>https://community.esri.com/t5/python-questions/import-lyr-file-to-entire-project/m-p/702491#M54439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is an example on how to add the layer file to your current MXD:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import mapping

mxd = mapping.MapDocument("CURRENT")
df = mapping.ListDataFrames(mxd, "Layers")[0]
addLayer = arcpy.mapping.Layer(r"C:\DATA\PA_DEM.lyr")

mapping.AddLayer(df, addLayer)

arcpy.RefreshTOC()
arcpy.RefreshActiveView()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is an example on how to add the layer file to a particular group layer in your current MXD:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import mapping

mxd = mapping.MapDocument("CURRENT")
df = mapping.ListDataFrames(mxd, "Layers")[0]

targetGroupLayer = mapping.ListLayers(mxd, "L00 (147,748K)", df)[0]
addLayer = mapping.Layer(r"C:\DATA\PA_DEM.lyr")
mapping.AddLayerToGroup(df, targetGroupLayer, addLayer, "BOTTOM")

arcpy.RefreshTOC()
arcpy.RefreshActiveView()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:32:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-lyr-file-to-entire-project/m-p/702491#M54439</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T05:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Import lyr file to entire project</title>
      <link>https://community.esri.com/t5/python-questions/import-lyr-file-to-entire-project/m-p/702492#M54440</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;BR /&gt;&lt;SPAN&gt;Thanks for the code but I think I didn�??t explain myself very well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What I meant was importing a raster symbology lyr file. I have about 200 rasters that I made using model builder and I need to uniform all classification intervals. When I use the model builder to produce rasters from kriging they always come out&amp;nbsp; in the form of stretched&amp;nbsp; with values differing in each raster, which usually I have to import the symbology lyr file one by one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So what I�??m looking for is a way, which I think only code will solve, to make possible importing the symbology (lyr) file to the rest of the rasters in the project, or a group layer giving them all the same classification values making them more comparable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any help&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Patrao&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 09:17:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-lyr-file-to-entire-project/m-p/702492#M54440</guid>
      <dc:creator>PatrãoPedro</dc:creator>
      <dc:date>2011-04-11T09:17:41Z</dc:date>
    </item>
  </channel>
</rss>

