Hi all,
I'm working on a script that uses the 'memory' workspace as layers are being processed, and I've hit an issue when I try to execute a field calculation between joined layers. I have included a script below that demonstrates the differences between workflows - the calculation will work fine if I create the feature layers from layers on disk, but will fail if the feature layers are created from layers in the memory workspace - testtype "fromdisk" works but testtype "frommemory" does not.
<SPAN class="keyword token">import</SPAN> arcpy
inLine <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"D:\TEMP\Output_20200520080600.gdb\LINE00240"</SPAN>
inPoint <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"D:\TEMP\Output_20200520080600.gdb\StructureJoin"</SPAN>
testtype <SPAN class="operator token">=</SPAN> <SPAN class="string token">"fromdisk"</SPAN>
<SPAN class="keyword token">if</SPAN> testtype <SPAN class="operator token">==</SPAN> <SPAN class="string token">"fromdisk"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="comment token"># Features are stored on disk</SPAN>
<SPAN class="comment token"># Feature layers are created from layers on disk</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Running disk workflow"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Make feature layers</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>MakeFeatureLayer_management<SPAN class="punctuation token">(</SPAN>inLine<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"LineFeature"</SPAN><SPAN class="punctuation token">)</SPAN>