<?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 Dynamically add features to map in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/dynamically-add-features-to-map/m-p/1022136#M36701</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to dynamically add the contents of a feature dataset to a map in Pro v 2.7.&lt;/P&gt;&lt;P&gt;To achieve this, my understanding of the workflow is that I need to list the features in the feature dataset ('ResultsPath' in code snippet below), then convert to layer, save as a layer file, then add layer. The code below runs without errors, but nothing happens--nothing is added to the map and no layer files are generated.&amp;nbsp; Any pointers? Thanks in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Lists the feature classes in the Results Feature Dataset
#Dynamically convert to layer and add to map.
#Code working, but nothing happening? 
m = aprx.listMaps()[0]
for fc in arcpy.ListFeatureClasses(ResultsPath):
    OutFile = ScratchWS + os.sep + str(fc)
    lf = arcpy.MakeFeatureLayer_management(fc, OutFile, None, None).getOutput(0)
    lyf = arcpy.management.SaveToLayerFile(lf, OutFile)
    m.addLayer(lyf, "AUTO_ARRANGE")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Feb 2021 15:40:48 GMT</pubDate>
    <dc:creator>PenelopeMitchell2</dc:creator>
    <dc:date>2021-02-01T15:40:48Z</dc:date>
    <item>
      <title>Dynamically add features to map</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/dynamically-add-features-to-map/m-p/1022136#M36701</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to dynamically add the contents of a feature dataset to a map in Pro v 2.7.&lt;/P&gt;&lt;P&gt;To achieve this, my understanding of the workflow is that I need to list the features in the feature dataset ('ResultsPath' in code snippet below), then convert to layer, save as a layer file, then add layer. The code below runs without errors, but nothing happens--nothing is added to the map and no layer files are generated.&amp;nbsp; Any pointers? Thanks in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Lists the feature classes in the Results Feature Dataset
#Dynamically convert to layer and add to map.
#Code working, but nothing happening? 
m = aprx.listMaps()[0]
for fc in arcpy.ListFeatureClasses(ResultsPath):
    OutFile = ScratchWS + os.sep + str(fc)
    lf = arcpy.MakeFeatureLayer_management(fc, OutFile, None, None).getOutput(0)
    lyf = arcpy.management.SaveToLayerFile(lf, OutFile)
    m.addLayer(lyf, "AUTO_ARRANGE")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 15:40:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/dynamically-add-features-to-map/m-p/1022136#M36701</guid>
      <dc:creator>PenelopeMitchell2</dc:creator>
      <dc:date>2021-02-01T15:40:48Z</dc:date>
    </item>
  </channel>
</rss>

