<?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 Re: Convert Result Object to GDB Table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689260#M53397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's the full code, though it's evolved a bit since the original post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For the sake of brevity, I'm not posting the entire code here. Just the section causing issues but I do know for a fact that the issue is within the section. I'm also just using the 'cbsaFD' variable statically for testing purposes however, in the actual code 'cbsaFD' represents an list item to iterate through using a for-loop (ie: for cbsaFD in cbsaFD_set). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a prior step, the 'bgCentroids', 'proForma' and 'AOIs' were clipped to the extent of the the CBSA boundary with which they intersect using SelectLayerByLocation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.env.workspace = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb\CBSA_12345"
arcpy.env.overwriteOutput = True
GDB = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb"
cbsaFD = "CBSA_12345"
bgCentroids = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb\CBSA_12345\CBSA_12345_bgCentroids"
proForma = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb\CBSA_12345\CBSA_12345_proForma"
AOIs = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb\CBSA_12345\CBSA_12345_RN"
inOrigins = bgCentroids
inDestinations = proForma
inNetworkDataset = r"C:\ArcGIS\Business Analyst\US\Data\StreetMapData\streets"
outNALayerName = "BG2Branches"
impedenceAttribute = "Length"
outLayerFile = outNALayerName + ".lyr"
outNALayer = arcpy.MakeODCostMatrixLayer_na(inNetworkDataset, outNALayerName, "Length", "", "", "", "", "", "USE_HIERARCHY", "", "NO_LINES")

outNALayer = outNALayer.getOutput(0)

subLayerNames = arcpy.na.GetNAClassNames(outNALayer)
originsLayerName = subLayerNames["Origins"]
originsFieldMap = arcpy.na.NAClassFieldMappings(outNALayer, originsLayerName)
originsFieldMap["Name"].mappedFieldName = "BG_ID"
arcpy.na.AddLocations(outNALayer, originsLayerName, inOrigins, originsFieldMap)

destinationsLayerName = subLayerNames["Destinations"]
destinationsFieldMap = arcpy.na.NAClassFieldMappings(outNALayer, destinationsLayerName)
destinationsFieldMap["Name"].mappedFieldName = "DID"
arcpy.na.AddLocations(outNALayer, destinationsLayerName, inDestinations, destinationsFieldMap)

arcpy.na.Solve(outNALayer)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So in an ArcMap Session, I can grab the result object exactly as you said by referencing the Feature Layer directly out of the TOC and export it to a table:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.TableToTable_conversion(r"BG2Branches\Lines", cbsaFD + "_ODCM")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem arises when I do this through Catalog. Since there is no way to reference the feature directly because ArcMap did not automatically convert the result object to a Feature Layer, I have to do this myself. No sweat, right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.MakeFeatureLayer_management(outLayerName, cbsaFD + "ODCM", "", GDB)
Runtime error&amp;nbsp; Traceback (most recent call last):&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&amp;nbsp;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 5748, in MakeFeatureLayer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e ExecuteError: ERROR 000732: Input Features: Dataset BG2Branches.lyr does not exist or is not supported
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;So...I tried doing an arcpy.Describe and get an Object Does Not Exist error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So then I tried instantiating the result object under a variable:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Branch2BG_ODCM_LYR = arcpy.Solve(outNALayer)
Branch2BG_ODCM_LYR = Branch2BG_ODCM_LYR.getOutput(0)
print Branch2BG_ODCM_LYR
GPL0
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Whoo hoo, have the object reference under a variable, yay!&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.Describe(Branch2BG_ODCM_LYR)
Runtime error 
Traceback (most recent call last):
&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 1200, in Describe
&amp;nbsp;&amp;nbsp;&amp;nbsp; return gp.describe(value)
&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 374, in describe
&amp;nbsp;&amp;nbsp;&amp;nbsp; self._gp.Describe(*gp_fixargs(args, True)))
IOError: "GPL0" does not exist
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What in holy heck is going on here?!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:00:10 GMT</pubDate>
    <dc:creator>JohnDye</dc:creator>
    <dc:date>2021-12-12T05:00:10Z</dc:date>
    <item>
      <title>Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689254#M53391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a table being returned from the Network Analyst OD Cost Matrix...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to convert the result object to a GDB Table and I tried using this..&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ODCM_Table = arcpy.na.Solve(outNALayer) #Solves the Origin-Destination Cost Matrix and produces the ODCM_Table
arcpy.TableToTable_conversion(ODCM_Table, workspace + "\Default.gdb", "ODCM") # Thought this should convert result to GDB Table
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;But it throws an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Runtime error Traceback (most recent call last): File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt; File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\conversion.py", line 1904, in TableToTable raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Rows: Dataset GPL0 does not exist or is not supported Failed to execute (TableToTable).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought maybe the cause of the error was the formatting of the result object being held on the 'ODCM_Table' variable, so I printed it to see what it returns...&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
print ODCM_Table
GPL0
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;No problem I can see there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So how can I convert this result object to an actual table?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:48:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689254#M53391</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2021-12-12T16:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689255#M53392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you table is just a standard row/column table and the table2table isn't working, maybe something like this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

arcpy.CreateTable_management(temp_gdb, "temp_table", "D:\\temp.gdb\\template_table", "")&amp;nbsp; ## use template table with column headings to create new empty table

with da.InsertCursor(temp_table,['FIELD1', FIELD2']) as insert:&amp;nbsp;&amp;nbsp;&amp;nbsp; ## if the column names match the table, should just insert right in.

&amp;nbsp; for row in ODCM_Table:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert.insertRow(row)
&amp;nbsp; del row
del insert


&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, sometimes when table2table doesn't work, you can use copyRows to get the same thing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:59:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689255#M53392</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2021-12-12T04:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689256#M53393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are trying to get the lines object from an od cost matrix, you will need to use the "Select" tool. It would look something like this (sorry it's a dirty example):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ND = "your network dataset"
OD_Lines = "output location for table
Lines = r"OD_Matrix\Lines"
OD_Matrix = "OD_Matrix"

arcpy.MakeODCostMatrixLayer_na(ND,OD_Matrix,"Distance","","1")
arcpy.AddLocations_na(OD_Matrix, "Origins", "your input")
arcpy.AddLocations_na(OD_Matrix, "Destinations", "your input")
arcpy.Solve_na(OD_Matrix, "SKIP","CONTINUE")
arcpy.Select_analysis(Lines, OD_Lines)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689256#M53393</guid>
      <dc:creator>BradShore1</dc:creator>
      <dc:date>2021-12-12T05:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689257#M53394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you are trying to get the lines object from an od cost matrix, you will need to use the "Select" tool. It would look something like this (sorry it's a dirty example):&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ND = "your network dataset"
OD_Lines = "output location for table
Lines = r"OD_Matrix\Lines"
OD_Matrix = "OD_Matrix"

arcpy.MakeODCostMatrixLayer_na(ND,OD_Matrix,"Distance","","1")
arcpy.AddLocations_na(OD_Matrix, "Origins", "your input")
arcpy.AddLocations_na(OD_Matrix, "Destinations", "your input")
arcpy.Solve_na(OD_Matrix, "SKIP","CONTINUE")
arcpy.Select_analysis(Lines, OD_Lines)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems this only works if you're doing it from the Python Window in ArcMap. Otherwise, I can't seem to get an instantiation of the Lines object. I've tried directly referencing the result object through a variable but then when I try to do something with it it says it doesnt exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I run the exact same code in Catalog...no workie.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689257#M53394</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2021-12-12T05:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689258#M53395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Often when things like this work in ArcMap, but not stand alone python, I find that it is because ArcMap converts needed layers/tables to featureLayers/featuretables on the fly, and is transparent to the user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When this happens, I just makeFeatureLayer (or makefeaturetable) first, then do my select on that. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You might also need to update your paths.&amp;nbsp; These look like they are "relative" to the map document scratch gdb or something, as they are not complete.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ND = "your network dataset"
OD_Lines = "output location for table
Lines = r"OD_Matrix\Lines"
OD_Matrix = "OD_Matrix"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In case this is your issue,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689258#M53395</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2021-12-12T05:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689259#M53396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Often when things like this work in ArcMap, but not stand alone python, I find that it is because ArcMap converts needed layers/tables to featureLayers/featuretables on the fly, and is transparent to the user (what you pick from the dropdown in ArcMap is often a featurelayer, not the layer itself).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When this happens, I just makeFeatureLayer (or makefeaturetable) in python first, then do my select on that. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if you just edited these for posting, but if not, You might also need to update your paths.&amp;nbsp; These look like they are "relative" to the map document scratch gdb or something, as they don't look "pytonic", so not sure it knows where to look/save.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I.e., how does python know what drive/server/etc to look for the path "OD_Matrix\"?&amp;nbsp; Is that r"C:\OD_Matrix\", r"\\servername\share\OD_Matrix\" or where?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ND = "your network dataset"
OD_Lines = "output location for table
Lines = r"OD_Matrix\Lines"
OD_Matrix = "OD_Matrix"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have no experience in OD matricies, so not sure if I'm even in the ballpark here.&amp;nbsp; But, In case this is your issue,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689259#M53396</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2021-12-12T05:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689260#M53397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's the full code, though it's evolved a bit since the original post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For the sake of brevity, I'm not posting the entire code here. Just the section causing issues but I do know for a fact that the issue is within the section. I'm also just using the 'cbsaFD' variable statically for testing purposes however, in the actual code 'cbsaFD' represents an list item to iterate through using a for-loop (ie: for cbsaFD in cbsaFD_set). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a prior step, the 'bgCentroids', 'proForma' and 'AOIs' were clipped to the extent of the the CBSA boundary with which they intersect using SelectLayerByLocation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.env.workspace = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb\CBSA_12345"
arcpy.env.overwriteOutput = True
GDB = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb"
cbsaFD = "CBSA_12345"
bgCentroids = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb\CBSA_12345\CBSA_12345_bgCentroids"
proForma = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb\CBSA_12345\CBSA_12345_proForma"
AOIs = r"C:\ArcGIS\SYSTEM\COF\Data\CapitalOne.gdb\CBSA_12345\CBSA_12345_RN"
inOrigins = bgCentroids
inDestinations = proForma
inNetworkDataset = r"C:\ArcGIS\Business Analyst\US\Data\StreetMapData\streets"
outNALayerName = "BG2Branches"
impedenceAttribute = "Length"
outLayerFile = outNALayerName + ".lyr"
outNALayer = arcpy.MakeODCostMatrixLayer_na(inNetworkDataset, outNALayerName, "Length", "", "", "", "", "", "USE_HIERARCHY", "", "NO_LINES")

outNALayer = outNALayer.getOutput(0)

subLayerNames = arcpy.na.GetNAClassNames(outNALayer)
originsLayerName = subLayerNames["Origins"]
originsFieldMap = arcpy.na.NAClassFieldMappings(outNALayer, originsLayerName)
originsFieldMap["Name"].mappedFieldName = "BG_ID"
arcpy.na.AddLocations(outNALayer, originsLayerName, inOrigins, originsFieldMap)

destinationsLayerName = subLayerNames["Destinations"]
destinationsFieldMap = arcpy.na.NAClassFieldMappings(outNALayer, destinationsLayerName)
destinationsFieldMap["Name"].mappedFieldName = "DID"
arcpy.na.AddLocations(outNALayer, destinationsLayerName, inDestinations, destinationsFieldMap)

arcpy.na.Solve(outNALayer)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So in an ArcMap Session, I can grab the result object exactly as you said by referencing the Feature Layer directly out of the TOC and export it to a table:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.TableToTable_conversion(r"BG2Branches\Lines", cbsaFD + "_ODCM")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem arises when I do this through Catalog. Since there is no way to reference the feature directly because ArcMap did not automatically convert the result object to a Feature Layer, I have to do this myself. No sweat, right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.MakeFeatureLayer_management(outLayerName, cbsaFD + "ODCM", "", GDB)
Runtime error&amp;nbsp; Traceback (most recent call last):&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&amp;nbsp;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 5748, in MakeFeatureLayer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e ExecuteError: ERROR 000732: Input Features: Dataset BG2Branches.lyr does not exist or is not supported
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;So...I tried doing an arcpy.Describe and get an Object Does Not Exist error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So then I tried instantiating the result object under a variable:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Branch2BG_ODCM_LYR = arcpy.Solve(outNALayer)
Branch2BG_ODCM_LYR = Branch2BG_ODCM_LYR.getOutput(0)
print Branch2BG_ODCM_LYR
GPL0
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Whoo hoo, have the object reference under a variable, yay!&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.Describe(Branch2BG_ODCM_LYR)
Runtime error 
Traceback (most recent call last):
&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 1200, in Describe
&amp;nbsp;&amp;nbsp;&amp;nbsp; return gp.describe(value)
&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 374, in describe
&amp;nbsp;&amp;nbsp;&amp;nbsp; self._gp.Describe(*gp_fixargs(args, True)))
IOError: "GPL0" does not exist
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What in holy heck is going on here?!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689260#M53397</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2021-12-12T05:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689261#M53398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I have a table being returned from the Network Analyst OD Cost Matrix...&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;I want to convert the result object to a GDB Table and I tried using this..&amp;nbsp; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ODCM_Table = arcpy.na.Solve(outNALayer) #Solves the Origin-Destination Cost Matrix and produces the ODCM_Table
arcpy.TableToTable_conversion(ODCM_Table, workspace + "\Default.gdb", "ODCM") # Thought this should convert result to GDB Table
&lt;/PRE&gt; &lt;BR /&gt;But it throws an error:&amp;nbsp; &lt;BR /&gt; &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;Runtime error Traceback (most recent call last): File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt; File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\conversion.py", line 1904, in TableToTable raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Rows: Dataset GPL0 does not exist or is not supported Failed to execute (TableToTable).&lt;BR /&gt;&lt;/SPAN&gt; &lt;BR /&gt;I thought maybe the cause of the error was the formatting of the result object being held on the 'ODCM_Table' variable, so I printed it to see what it returns...&amp;nbsp; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;
print ODCM_Table
GPL0
&lt;/PRE&gt; &lt;BR /&gt;No problem I can see there.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;So how can I convert this result object to an actual table?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure what your source table is (.dbf?), but another possible solution is to convert this source into a NumPyArray first then convert this nparray into a gdb table. This could very easily be done by implementing arcpy.da.TableToNumPyArray (&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000018000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000018000000&lt;/A&gt;&lt;SPAN&gt;), then issue arcpy.da.NumPyArrayToTable on that nparray (&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/NumPyArrayToTable/018w00000016000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/NumPyArrayToTable/018w00000016000000/&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tested this with a dbf table (numpytab_out.dbf) and converted it to the Default.gdb as a table with the above described method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import numpy as np

oLoc = r"C:\Documents\ArcGIS\Default.gdb"
tLoc = r"C:\Documents\ArcGIS"
datasource = r"H:\Documents\ArcGIS\numpytab_out.dbf"

#list out your fieldnames
flds = ['staname', 'change']

#convert the dbf to a numpyarray obj
numpytab = arcpy.da.TableToNumPyArray(datasource, flds)

##check to see if intermediate table numpytab exists and delete it if so
arcpy.env.workspace = oLoc
arcpy.env.overwriteOutput = True
tabs2 = arcpy.ListTables()
for tab2 in tabs2:
&amp;nbsp;&amp;nbsp; if tab2=="numpytab_out":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(r"H:\Documents\ArcGIS\Default.gdb\numpytab_out")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("....Deleted numpytab_out")
&amp;nbsp; 
##now covert the numpyarray to the gdb table in the default.gdb&amp;nbsp;&amp;nbsp; 
arcpy.da.NumPyArrayToTable(numpytab, r"H:\Documents\ArcGIS\Default.gdb\numpytab_out")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry if this is way off base or sets you off into an unecessary direction, but it is an option. And I do have some similar methodology in production now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689261#M53398</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-12T05:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689262#M53399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm not sure what your source table is (.dbf?), &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey James, any insight is useful. The ODCM_Table should just be holding the result object from the OD Cost Matrix in Network Analyst. The OD Cost Matrix analysis layer 'outNALayer' is composed of six network analyst classes, one of which is 'Lines' which stores the path information, like Total Length from Origin to Destination. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So really the question here is how can I convert the an NA Class to a Table, or Feature Layer outside of an ArcMap Session. It doesn't seem possible.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 17:56:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689262#M53399</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2013-06-11T17:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689263#M53400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hey James, any insight is useful. The ODCM_Table should just be holding the result object from the OD Cost Matrix in Network Analyst. The OD Cost Matrix analysis layer 'outNALayer' is composed of six network analyst classes, one of which is 'Lines' which stores the path information, like Total Length from Origin to Destination. &lt;BR /&gt;&lt;BR /&gt;So really the question here is how can I convert the an NA Class to a Table, or Feature Layer outside of an ArcMap Session. It doesn't seem possible.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a FeatureClassToNumPyArray function (&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000015000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000015000000&lt;/A&gt;&lt;SPAN&gt;) that you could try to pass in this NA Class as it accepts a feature class, layer, table, or table view as input parameter.&amp;nbsp; In my previous example, just replace arcpy.da.TableToNumPyArray with this FeatureClassToNumPyArray.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you writing this outNALayer to disk somewhere?&amp;nbsp; Just specifiy this as the input FeatureLayer rather than how you have it in your OP: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;outNALayer = outNALayer.getOutput(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again, sorry if this is way off.&amp;nbsp; I guess worth a try though.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 18:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689263#M53400</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2013-06-11T18:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689264#M53401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think I've angered the GIS gods...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.da.FeatureClassToNumPyArray(ODCM_LYR, "*")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Runtime error &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: cannot open 'C:\ArcGIS\SYSTEM\COF\Data\BG2Branches.lyr'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:48:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689264#M53401</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2021-12-12T16:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689265#M53402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I think I've angered the GIS gods...&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.da.FeatureClassToNumPyArray(ODCM_LYR, "*")
&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;Runtime error &lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt;RuntimeError: cannot open 'C:\ArcGIS\SYSTEM\COF\Data\BG2Branches.lyr'&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a BG2Branches Feature Class (not a .lyr)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689265#M53402</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-12T05:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689266#M53403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is there a BG2Branches Feature Class (not a .lyr)?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nope. That's the point. This is supposed to produce that Feature Layer which I can then convert to an FC.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 20:10:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689266#M53403</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2013-06-11T20:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689267#M53404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't see where you are assigning ODCM_LYR to anything, is that just missing from the posted code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;also, if you are trying to convert from the numpyarray to FC, wouldn't that be NumPyArrayToFeatureClass instead of FeatureClassToNumPyArray ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 20:44:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689267#M53404</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2013-06-11T20:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689268#M53405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I don't see where you are assigning ODCM_LYR to anything, is that just missing from the posted code.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey Rhett,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for following up. I appreciate the efforts. Sorry, I should have included the reference. In that particular test, 'ODCM_LYR' was referenced to the result object using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ODCM_LYR = arcpy.na.Solve(outNALayer)
ODCM_LYR = ODCM_LYR.getOutput(0)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;also, if you are trying to convert from the numpyarray to FC, wouldn't that be NumPyArrayToFeatureClass instead of FeatureClassToNumPyArray ?&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this test, I wasn't trying to convert from a numpy array to FC, I was trying to get the Lines NA Class into a Numpy Array and then follow that up with a NumpPyArraytoTable to get the table. I never got it into the array though =(&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently, I'm working around all of this by running the tool out of Arcmap and extracting the table directly using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.TableToTable_conversion("BG2Branches\Lines", workspace, str(cbsaFD) + "_ODCM") 

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and it works just fine...but I dont think I should be forced to run this out of ArcMap only. It should be executable through Catalog or as a Standalone Script as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689268#M53405</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2021-12-12T05:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689269#M53406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You say it is working just fine in ArcMap, if Table to Table is working in ArcMap, then it will run as standalone as well (I use this all the time in my standalone scripts.&amp;nbsp; however, some datasets don't support it, and CopyRows can often be used to achieve same result on these).&amp;nbsp; Have you ran it in ArcMap, then after it finishes, Go to the Geoprocessing window, Results, expand Current Session and right-click on the Table to Table entry.&amp;nbsp; Then pick, "Copy as python snippet".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you should be able to paste that snippet directly in python as standalone or within ArcDesktop (might have to change paths/variable names).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry I can't be more help, but have never had the need for numpy stuff,&amp;nbsp; don't know what the .solve, .getOutput results would look like, or what they contain.&amp;nbsp; Without understanding what the "data" itself looks like/formatted, my input will be limited.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 21:23:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689269#M53406</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2013-06-11T21:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689270#M53407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Rhett,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I pulled the Python snippet through arcmap and this was it returned:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script # The following inputs are layers or table views: "BG2Branches\Lines" arcpy.TableToTable_conversion("BG2Branches/Lines","C:/Users/jdk588/Documents/ArcGIS/Default.gdb","ODCM_Test","#","""Name "Name" true true true 128 Text 0 0 ,First,#,/ODLines,Name,-1,-1;OriginID "OriginID" true true true 4 Long 0 0 ,First,#,/ODLines,OriginID,-1,-1;DestinationID "DestinationID" true true true 4 Long 0 0 ,First,#,/ODLines,DestinationID,-1,-1;DestinationRank "DestinationRank" true true true 4 Long 0 0 ,First,#,/ODLines,DestinationRank,-1,-1;Total_Length "Total_Length" true true true 8 Double 0 0 ,First,#,/ODLines,Total_Length,-1,-1""","#")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see, it still references the 'BG2Branches\Lines' which is accessible in ArcMap but not ArcCatalog. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue is that the the BG2Branches is some sort of composite NA Layer, and is not written to disk anywhere. It's like a Group Layer of some sort, and there's no real method to get the sublayers without an instantiation in a dataframe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have figured out a solution that works without having to run the tool from ArcMap. Basically, I just save the result to a layer file, then use the mapping module to leverage an ArcGIS Template MXD and load the layer into the Template MXD's Dataframe. One that's done, I can extract the table from the Template MXD's Dataframe without ever having to actually open the MXD. After the 'TableToTable_conversion' is complete and I have a copy of the table on disk, I remove the layer from the Template MXD and then delete the actual layer file. It takes about 1-2 minutes for all of that to occur, so not too shabby.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;arcpy.na.Solve(outNALayer) arcpy.SaveToLayerFile_management(outNALayer, workspace + "\\" + outLayerFile, "RELATIVE")&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(r" C:\Program Files (x86)\ArcGIS\Desktop10.1\MapTemplates\Traditional Layouts\LetterPortrait.mxd") df = arcpy.mapping.ListDataFrames(mxd)[0] addlyr = arcpy.mapping.Layer(r???C:\Temp\BG2Branches.lyr") arcpy.mapping.AddLayer(df, addlyr) for lyr in df: if lyr.name == "Lines": &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.TableToTable_conversion(lyr, addlyr, "ODCM_Table") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.RemoveLayer(df, lyr) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(workspace + ???\\??? + str(addlyr) + ???.lyr???) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError (???ODCM Lines Not Found.???)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 18:24:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689270#M53407</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2013-06-12T18:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689271#M53408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wasn't really thinking about the layer not being available out of ArcMap, as i don't pick the layer from the dropdown, I always click the folder and browse to it.&amp;nbsp; The "layers" in the dropdown are often auto-created views.&amp;nbsp; When browse to the datasource, if it is not a compatible type, it will not be visible to pick from.&amp;nbsp; in this case, that is when I know I have to bring in the FC and make a view first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now that you have it working as far as saving to a layer file, have you tried the TableToTable on the layer file itself?&amp;nbsp; .lyr files are acceptable input to the TableToTable tool, and I can dump the table to a new one straight from any of my layer files (though, none of them are from a na.solve)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

outfile =&amp;nbsp; workspace + "\\" + outLayerFile
newtable = workspace + "\\" + "ODCM_Table"

arcpy.na.Solve(outNALayer)
arcpy.SaveToLayerFile_management(outNALayer, outfile , "RELATIVE")

arcpy.TableToTable_conversion(outfile ,newtable,"#","#","#")

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would think something like this would work without the load of .mapping.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689271#M53408</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2021-12-12T05:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689272#M53409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is what I do. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;class LicenseError(Exception):
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass

import arcpy, os, traceback, sys, tkMessageBox
from arcpy import env
arcpy.env.overwriteOutput = True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

#Checkout Network Analyst License
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.CheckExtension("Network") == "Available":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CheckOutExtension("Network")
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Raise a custom exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise LicenseError


#Set Variables
&amp;nbsp;&amp;nbsp;&amp;nbsp; Members = r"C:\ArcGIS\HSD\HSD_May2013\HSD.gdb\Members"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Shell_D = r"C:\ArcGIS\HSD\HSD_May2013\HSD.gdb\Shell_D"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Distance = r"C:\ArcGIS\HSD\HSD_May2013\HSD.gdb\Distance"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ND = r"C:\ArcGIS\Geodabases\Basemap.gdb\na\na_ND"
&amp;nbsp;&amp;nbsp;&amp;nbsp; OD_Lines = r"in_memory\OD_Lines"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Lines = r"OD_Matrix\Lines"
&amp;nbsp;&amp;nbsp;&amp;nbsp; OD_Matrix = "OD_Matrix"


#Processes for Distance Analysis
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeODCostMatrixLayer_na(ND,OD_Matrix,"Distance","","1")
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddLocations_na(OD_Matrix, "Origins", Members, "", "", "", "", "", "Clear")
&amp;nbsp;&amp;nbsp;&amp;nbsp; env.workspace = r"C:\ArcGIS\HSD\HSD_May2013\Database"
&amp;nbsp;&amp;nbsp;&amp;nbsp; workspaces = arcpy.ListWorkspaces("Distance*", "FileGDB")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for workspace in workspaces:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expression1 = workspace[-6:-4]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Distance: " + expression1 + " Miles"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; env.workspace = workspace&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fclist = arcpy.ListFeatureClasses()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fc in fclist:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expression2 = '"' + str(fc[4:8]) + '"'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(Shell_D, "SpecialtyCode", expression2, "PYTHON_9.3")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Calculating Distance for Specialty Code " + expression2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddLocations_na(OD_Matrix, "Destinations", fc, "Name Code #", "", "", "", "", "Clear")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Solve_na(OD_Matrix, "SKIP","CONTINUE")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Select_analysis(Lines, OD_Lines, "\"Total_Distance\" &amp;lt;=" + expression1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = arcpy.GetCount_management(OD_Lines)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(Shell_D, "Distance", count, "PYTHON_9.3")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management (Shell_D, Distance)

except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = sys.exc_info()[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp; tbinfo = traceback.format_tb(tb)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + "\nError Info:\n" + str(sys.exc_info()[1])
&amp;nbsp;&amp;nbsp;&amp;nbsp; tkMessageBox.showwarning("Error",pymsg)

finally:
# Check in the Network Analyst extension
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CheckInExtension("Network")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I remember correctly, I had to make the output of the OD Matrix an in memory table(using the arcpy.Select_analysis) and append it to an empty table. I think I kept getting an error if I tried writing the table straight to disk. The code above is in a standalone script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:00:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689272#M53409</guid>
      <dc:creator>BradShore1</dc:creator>
      <dc:date>2021-12-12T05:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Result Object to GDB Table</title>
      <link>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689273#M53410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Rhett, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I tried executing Table to Table directly against the result layer ('outNALayer') and it fails. Here's why:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The result layer object ('outNALayer') from the OD Cost Matrix is a Network Analyst Composite Layer which is made up of multiple sublayers, each of which references a particular Network Analyst object (Origins, Destinations, Point Barriers, Line Barriers, Polygon Barriers &amp;amp; Solved Route/Lines) used in the Network Analysis Solve function. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See this article: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//004700000034000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//004700000034000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT][/INDENT]"&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;The network analysis layer has its own properties, even though it is a composite layer made up of subordinate feature layers that in turn have their own sets of properties. Some of the network analysis layer properties are crucial to defining the analysis you want to perform. Properties include the impedance to be used and the restrictions to be obeyed, as well as the U-turn policy, output shape type, accumulation attributes, and properties for finding network locations. Additionally, each kind of analysis has specific properties of its own.&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Solved Route ('Lines') is what I was after once the OD Cost Matrix completes because I wanted the distance from the origin to the destination. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See this article: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00470000004r000000#GUID-823C3FF5-FE11-4D30-B50E-4B3CBBC05933"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00470000004r000000#GUID-823C3FF5-FE11-4D30-B50E-4B3CBBC05933&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT][/INDENT]"&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;The Lines network analysis class stores information about the resulting paths from the origins to the destinations. As with other feature layers, its symbology can be accessed and altered from its Layer Properties dialog box.&lt;BR /&gt;The Lines class is an output-only class; it is empty until the analysis is complete. Since OD cost matrix analyses tend to result in a multitude of lines, the line objects are not displayed in the Network Analyst window; rather, only a count of the lines is displayed there. You can inspect the individual lines in the attribute table of the Lines feature class.&lt;BR /&gt;When you choose to display lines in the OD cost matrix analysis layer, they appear as straight lines. They are generalized. However, their cost attributes always report the least-cost network path.&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue is that there is no way to access the Composite Layer ('outNALayer')'s sublayers (Origins, Destinations, Point Barriers, Line Barriers, Polygon Barriers &amp;amp; Solved Route/Lines) outside of a dataframe. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is why the only solution was to load the Composite Layer ('outNALayer') into an MXD, reference the dataframe, and extract from there. You cannot access the sublayers through any arcpy function that I've been able to find. You have to go through the dataframe to get to those objects/sublayers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 15:54:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-result-object-to-gdb-table/m-p/689273#M53410</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2013-06-13T15:54:19Z</dc:date>
    </item>
  </channel>
</rss>

