<?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 Add Layer to Open ArcGIS Pro Project in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/add-layer-to-open-arcgis-pro-project/m-p/1400551#M70159</link>
    <description>&lt;P&gt;I am trying to simply bring in a Feature Class from a File Geodatabase into an OPEN arcPro project&lt;BR /&gt;&lt;BR /&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;Error:&amp;nbsp;AttributeError: 'NoneType' object has no attribute 'addLayer'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy
import fileinput
import string
import os
from arcpy import env

# FILE GDB where the feature class to bring in resides
arcpy.env.workspace = r"C:\\Users\\ImportFeatureClass_Pro\\ProToolTest.gdb"

# ArcPRO Project Location of the OPEN ArcPro Project
aprx = arcpy.mp.ArcGISProject(r"C:\\Users\\ImportFeatureClass_Pro\\ImportFeatureClass_Pro.aprx")

aprxMap = aprx.activeMap

# The Feature Class from File GDB that I want brought into the OPEN ArcPro Project
file_location = r"C:\\Users\\ImportFeatureClass_Pro\\ProToolTest.gdb\MasonCliiped"

aprxMap.addLayer(file_location, "TOP")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Mar 2024 20:04:22 GMT</pubDate>
    <dc:creator>kapalczynski</dc:creator>
    <dc:date>2024-03-25T20:04:22Z</dc:date>
    <item>
      <title>Add Layer to Open ArcGIS Pro Project</title>
      <link>https://community.esri.com/t5/python-questions/add-layer-to-open-arcgis-pro-project/m-p/1400551#M70159</link>
      <description>&lt;P&gt;I am trying to simply bring in a Feature Class from a File Geodatabase into an OPEN arcPro project&lt;BR /&gt;&lt;BR /&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;Error:&amp;nbsp;AttributeError: 'NoneType' object has no attribute 'addLayer'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy
import fileinput
import string
import os
from arcpy import env

# FILE GDB where the feature class to bring in resides
arcpy.env.workspace = r"C:\\Users\\ImportFeatureClass_Pro\\ProToolTest.gdb"

# ArcPRO Project Location of the OPEN ArcPro Project
aprx = arcpy.mp.ArcGISProject(r"C:\\Users\\ImportFeatureClass_Pro\\ImportFeatureClass_Pro.aprx")

aprxMap = aprx.activeMap

# The Feature Class from File GDB that I want brought into the OPEN ArcPro Project
file_location = r"C:\\Users\\ImportFeatureClass_Pro\\ProToolTest.gdb\MasonCliiped"

aprxMap.addLayer(file_location, "TOP")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 20:04:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-layer-to-open-arcgis-pro-project/m-p/1400551#M70159</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2024-03-25T20:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Add Layer to Open ArcGIS Pro Project</title>
      <link>https://community.esri.com/t5/python-questions/add-layer-to-open-arcgis-pro-project/m-p/1400567#M70161</link>
      <description>&lt;P&gt;I think is not possible lyrx normally in to&amp;nbsp; Gdb?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 20:10:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-layer-to-open-arcgis-pro-project/m-p/1400567#M70161</guid>
      <dc:creator>RocioRey</dc:creator>
      <dc:date>2024-03-25T20:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Add Layer to Open ArcGIS Pro Project</title>
      <link>https://community.esri.com/t5/python-questions/add-layer-to-open-arcgis-pro-project/m-p/1400574#M70162</link>
      <description>&lt;P&gt;Which of the three options are you using to run your code?&lt;/P&gt;&lt;P&gt;activemap&lt;/P&gt;&lt;P&gt;This property is designed to be run from within the application using a script tool, the Python window, or a Notebook. If a script is run outside of the application, a value of None will always be returned.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_blank"&gt;ArcGISProject—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 20:14:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-layer-to-open-arcgis-pro-project/m-p/1400574#M70162</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-03-25T20:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add Layer to Open ArcGIS Pro Project</title>
      <link>https://community.esri.com/t5/python-questions/add-layer-to-open-arcgis-pro-project/m-p/1403023#M70221</link>
      <description>&lt;P&gt;addLayer() isn't great since it calls for a layer file or a pre-existing.&lt;/P&gt;&lt;P&gt;Try &lt;SPAN&gt;addDataFromPath() instead to make a new layer from scratch.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 23:50:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-layer-to-open-arcgis-pro-project/m-p/1403023#M70221</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-03-29T23:50:55Z</dc:date>
    </item>
  </channel>
</rss>

