Work around for using output memory\ with a domain.

765
4
11-18-2019 11:47 AM
deleted-user-yC5VkbyXzrQR
Occasional Contributor

Hello, 

My script is failing because I'm trying to output a feature class that has domains into memory. Is there any work around for this yet? 

You can ignore all the other code its just line 10 that fails. It works with any other feature except ones that have a domain. I'm pretty sure that is why the script fails. 

  ERROR 000210: Cannot create output memory\queryResidentsBuildings

#This "for loop" is used for preset layers in the APRX. 
if li != [""]:       
    for item in li:
        q = item.split(" ", 1)[0]  
        w = item.split(" ", 1)[1]  
        w = w.strip("\'")   
        lyr = mp.listLayers(q)[0]
        arcpy.AddMessage("Buffering "+ q + "..." )
        arcpy.management.SelectLayerByLocation(lyr, "INTERSECT", "AOI", "200 Meters", "NEW_SELECTION", "NOT_INVERT")
        arcpy.CopyFeatures_management(lyr,r"memory\query"+ q)
        e = q + w.split(" ", 1)[0] + w.split(" ", 1)[1] 
        arcpy.analysis.Buffer(r"memory\query"+ q, e+ "_buffer" , w, "FULL", "ROUND", "ALL", None, "PLANAR")
        aprx = arcpy.mp.ArcGISProject("CURRENT")
        mp = aprx.activeMap
        mp.addDataFromPath(fgdb + "\\" + e + "_buffer")
        aprx = arcpy.mp.ArcGISProject(aprxloc)
        mp = aprx.listMaps("Map")[0]
        limerge.append(os.path.join(fgdb,e+ "_buffer"))

Thanks, 

0 Kudos
4 Replies
JoshuaBixby
MVP Esteemed Contributor

I just copied a feature class with a domain-based field into in_memory and memory using Pro 2.5 beta.  I should be able to test a Pro 2.4.x machine too.

0 Kudos
deleted-user-yC5VkbyXzrQR
Occasional Contributor

really? I thought it was the domain because of this article from ESRI, but you're saying you copied feature to memory no problem ?

Write geoprocessing output to memory—ArcGIS Pro | ArcGIS Desktop 

Caution:
  • Memory-based workspaces do not support geodatabase elements such as feature datasets, subtypes, domains, representations, topologies, geometric networks, or network datasets
0 Kudos
DanPatterson_Retired
MVP Emeritus

That is what it says in the 2.5 Beta help as well

Joshua Bixby i‌f you can confirm this is not correct, you should  make a note with a link to this thread on the Help section

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

I will test a bit more this week.  I didn't actually test that the domain functionality worked in the memory workspaces, just that you could copy a feature class with domains over.  I would not be surprised if they copy over but the domain functionality does not come with them.

0 Kudos