AnsweredAssumed Answered

Adding Layers to a APRX python.

Question asked by deleted-user-yC5VkbyXzrQR on Oct 22, 2019
Latest reply on Nov 14, 2019 by deleted-user-yC5VkbyXzrQR

Does anyone know why line 1 - 3 does not add feature to the map to the map. 

 

But line 6 - 8 adds the feature to the map. 

 

Only difference is that I'm using the Path to the Aprx and not "Current". I was under the impression you can add add to the map with line 6 - 8 in a stand alone script. 

 

aprx = arcpy.mp.ArcGISProject(r'xxxxxx\\MyProject4\\MyProject5.aprx')
mpDEM = aprx.listMaps("Map2")[0]
mpDEM.addDataFromPath(r"C:\xxxxxxx\Adam.gdb\ProjectBoundary")


aprx = arcpy.mp.ArcGISProject("CURRENT")
mpDEM = aprx.listMaps("Map2")[0]
mpDEM.addDataFromPath(r"C:\xxxxxxx\Adam.gdb\ProjectBoundary")

Outcomes