According to the ArcGIS Pro support pages, "You can add memory datasets to a map in ArcGIS Pro.".
I have a layer in the 'memory' workspace that I would like to add to my current active map. I've tried:
mem_lyr = r"memory\Test_Layer"
aprx = arcpy.mp.ArcGISProject("CURRENT")
aprx_map = aprx.activeMap
aprx_map.addDataFromPath(mem_lyr)but get the below error. Is there a correct way to add layers in memory to the current map?
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 1862, in addDataFromPath
return convertArcObjectToPythonObject(self._arc_object.addDataFromPath(*gp_fixargs((data_path,), True)))
RuntimeError