<?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: Using ArcMap created Layer Files with ArcGIS Pro 3 (ArcPy) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-arcmap-created-layer-files-with-arcgis-pro-3/m-p/1314200#M68317</link>
    <description>&lt;P&gt;I think that's a method on the LayerFile class. I can't get the instantiation of the class to happen so I can't get that far. I'm using the first code sample and it dies on the lyrFile = arcpy.mp.LayerFile() line. I've checked to see if the file in my example above is a valid layer file and it opens up in both ArcMap 10.6.1 and ArcGIS Pro. It's nothing terribly exciting - address points with an transparent symbol and labeling turned on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2023 17:59:22 GMT</pubDate>
    <dc:creator>ScottDickison1</dc:creator>
    <dc:date>2023-08-01T17:59:22Z</dc:date>
    <item>
      <title>Using ArcMap created Layer Files with ArcGIS Pro 3 (ArcPy)</title>
      <link>https://community.esri.com/t5/python-questions/using-arcmap-created-layer-files-with-arcgis-pro-3/m-p/1314050#M68314</link>
      <description>&lt;P&gt;I am trying to write a script to convert .lyr files generated with ArcGIS 10.6.1 to ArcGIS Pro 3.0 .lyrx files in the Pro flavored version of ArcPy. In the documentation for the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layerfile-class.htm" target="_self"&gt;LayerFile&lt;/A&gt;&amp;nbsp;class it says that it provides access to .lyr files. When I try this:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;lf = arcpy.mp.LayerFile(r'M:\Production\Layerfile\Address\House Numbers.lyr')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It never returns and just hangs. Is the documentation out of date and you can no longer access .lyr files at 3.0? Is there a piece that I'm missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 13:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcmap-created-layer-files-with-arcgis-pro-3/m-p/1314050#M68314</guid>
      <dc:creator>ScottDickison1</dc:creator>
      <dc:date>2023-08-01T13:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcMap created Layer Files with ArcGIS Pro 3 (ArcPy)</title>
      <link>https://community.esri.com/t5/python-questions/using-arcmap-created-layer-files-with-arcgis-pro-3/m-p/1314184#M68316</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layerfile-class.htm" target="_blank"&gt;LayerFile—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you might want to check to see if the links to the original data are broken in the layer file first... perhaps try&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;listBrokenDataSources ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;first&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 17:29:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcmap-created-layer-files-with-arcgis-pro-3/m-p/1314184#M68316</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-08-01T17:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcMap created Layer Files with ArcGIS Pro 3 (ArcPy)</title>
      <link>https://community.esri.com/t5/python-questions/using-arcmap-created-layer-files-with-arcgis-pro-3/m-p/1314200#M68317</link>
      <description>&lt;P&gt;I think that's a method on the LayerFile class. I can't get the instantiation of the class to happen so I can't get that far. I'm using the first code sample and it dies on the lyrFile = arcpy.mp.LayerFile() line. I've checked to see if the file in my example above is a valid layer file and it opens up in both ArcMap 10.6.1 and ArcGIS Pro. It's nothing terribly exciting - address points with an transparent symbol and labeling turned on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 17:59:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcmap-created-layer-files-with-arcgis-pro-3/m-p/1314200#M68317</guid>
      <dc:creator>ScottDickison1</dc:creator>
      <dc:date>2023-08-01T17:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcMap created Layer Files with ArcGIS Pro 3 (ArcPy)</title>
      <link>https://community.esri.com/t5/python-questions/using-arcmap-created-layer-files-with-arcgis-pro-3/m-p/1314294#M68318</link>
      <description>&lt;P&gt;While searching for more answers I found this:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcpy-mp-layerfile-layer-filename-hangs/td-p/1217980" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-questions/arcpy-mp-layerfile-layer-filename-hangs/td-p/1217980&lt;/A&gt;. This fits our situation exactly. The arcpy.env.workspace needs to be pointed to the correct .sde file. However, the instance in the connection properties of layers within the .lyr must match the instance found in the .sde file or the script will hang when trying to instantiate a LayerFile. This gets messy to say the least. I'll keep pecking away at it.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 20:17:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcmap-created-layer-files-with-arcgis-pro-3/m-p/1314294#M68318</guid>
      <dc:creator>ScottDickison1</dc:creator>
      <dc:date>2023-08-01T20:17:34Z</dc:date>
    </item>
  </channel>
</rss>

