<?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: Simple python tool for WKT extraction- diagnosing error? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321230#M24981</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your error says, "Parameters are not valid." So, what are the parameters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outputName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next step, check the help doc and make sure the parameters are exactly the correct data type:&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/conversion/table-to-excel.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/conversion/table-to-excel.htm"&gt;Table To Excel—Conversion toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: the line specifying your workspace is probably wrong.&amp;nbsp;It should be the following, to use the variable value, not the string "outputDest":&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;arcpy&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;outputDest&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To be honest, environment variables are sometimes not worth the hidden trouble they can cause if not used carefully.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Oct 2018 22:18:30 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2018-10-16T22:18:30Z</dc:date>
    <item>
      <title>Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321221#M24972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I've written a short piece of code that takes a shapefile, copies to a .gdb, adds WKT attributes and outputs as an excel spreadsheet. The code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

&lt;SPAN class="comment token"&gt;###Get parameters as variables&lt;/SPAN&gt;
inputshp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
ouputDest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
outputName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###Copy shapefile to feature class in Default.gdb and add a field called WKT&lt;/SPAN&gt;
intFC &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureClassToFeatureClass_conversion&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; inputshp&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; inputshp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_table &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; intFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WKT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TEXT&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_length &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;100000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###Populate WKT column with WKT geometery&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"WKT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@WKT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
 cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###Set output folder to output folder as given by user&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; outputDest

&lt;SPAN class="comment token"&gt;###Create xls output&lt;/SPAN&gt;
TableToExcel_conversion &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outputName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###Delete intermittent feature class&lt;/SPAN&gt;
Delete_management &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intFC&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Finished"&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thus is then implemented in a tool with input parameters of: Shapefile, destination folder and excel spreadsheet name. In trying to run the tool however, I keep receiving the error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "S:\Works and Infrastructure Services\Infrastructure and Design\Technical Services\Asset Management\Robin\Python\AddWKT.py", line 10, in &amp;lt;module&amp;gt;&lt;BR /&gt; intFC = arcpy.FeatureClassToFeatureClass_conversion(in_features = inputshp, out_path = arcpy.env.workspace, out_name = inputshp)&lt;BR /&gt; File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\conversion.py", line 1790, in FeatureClassToFeatureClass&lt;BR /&gt; raise e&lt;BR /&gt;ExecuteError: ERROR 999999: Error executing function.&lt;BR /&gt;Failed to execute (FeatureClassToFeatureClass).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried and failed to diagnose this myself- I'm pretty new to python and this is a means to an end but also a learning experience- could anybody tell me what I'm doing wrong here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: If anyone can give me pointers on how to format a codeblock within this forum that would also be handy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:15:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321221#M24972</guid>
      <dc:creator>deleted-user-gYtz_UYfIh9y</dc:creator>
      <dc:date>2021-12-11T15:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321222#M24973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp; for code formatting.&lt;/P&gt;&lt;P&gt;When you are reformatting, throw a print statement in to see what&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;"SHAPE@WKT"&lt;/SPAN&gt; returns.&lt;/P&gt;&lt;P&gt;Also, try Copy instead of featureclasstofeatureclass.&lt;/P&gt;&lt;P&gt;Can the field length be 100000? I would give that a try manually (although I suspect it can)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;TableToExcel_conversion&amp;nbsp;&lt;/SPAN&gt; most likely going to fail if the field length can't be replicated in excel&lt;/P&gt;&lt;P&gt;But line numbers might help because the 999... error is generic&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 08:29:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321222#M24973</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-16T08:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321223#M24974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan. I have performed the same operation manually which returned the desired result, addressing points regarding field length, field length in excel and (possibly?) the nature of the "SHAPE@WKT" result. That is, field length of 100000 characters is possible (in a feature class, hence performing the conversion rather than updating the shapefile directly- if there is a way of simply stating greatest possible threshold on field length I don't know it although that would be useful as the WKT strings can be very long). The update cursor script works when it is run from the python window in ArcGIS directly. Conversion to excel works in manual test cases so far, although I suppose in theory the WKT string could end up surpassing an excel character limit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try replacing the conversion with a copy function. I'm also going to try replicating the script in model builder to see if I can glean any more information. Thanks for the info regarding code formatting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 21:01:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321223#M24974</guid>
      <dc:creator>deleted-user-gYtz_UYfIh9y</dc:creator>
      <dc:date>2018-10-16T21:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321224#M24975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try specifying a completely different value for in_features and out_name? It may be trying to read/write the same file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 21:09:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321224#M24975</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-10-16T21:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321225#M24976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wasn't sure if that might be contributing- essentially I want to take a shapefile in a folder location and create a temporary representation in the Default.gdb, but I'm now wondering if the workspace environment is being set to the folder location of the shapefile when it takes that input. If there was a way to work with the feature class representation without writing it to disk that would be ideal. I'm looking at the CopyFeatures option now as suggested by Dan but again it seems that workspace environment is being defined by the input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 21:30:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321225#M24976</guid>
      <dc:creator>deleted-user-gYtz_UYfIh9y</dc:creator>
      <dc:date>2018-10-16T21:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321226#M24977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robin, what is the value for 'inputshp'? Is it a path or just a filename?? If a filename, does it contain the .shp extension?? That might be causing the error, i.e. the&amp;nbsp;FeatureClassToFeatureClass_conversion is trying to create a featureclass named something.shp in the file geodatabase. You can't have a '.' in the featureclass name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps, Matthew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 21:42:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321226#M24977</guid>
      <dc:creator>MatthewDobson</dc:creator>
      <dc:date>2018-10-16T21:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321227#M24978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Matthew, looks like that did the trick. Thanks as well Darren, I think you were essentially saying the same thing. Few more bugs to iron out now but at least it's getting past the first function!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 21:56:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321227#M24978</guid>
      <dc:creator>deleted-user-gYtz_UYfIh9y</dc:creator>
      <dc:date>2018-10-16T21:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321228#M24979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan, as you can see below, I've resolved the initial error, but as you predicted it looks as though it is now falling over at the excel conversion. I've tried manually performing the process and it looks as though it is indeed running into the excel character limit- so this is something I will need to think my way around- but the error I'm receiving is different to the character limit error when manually performing the process.&amp;nbsp;Just for arguments sake,&amp;nbsp;can you pinpoint what might be going wrong with the script at that point? Revised script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

&lt;SPAN class="comment token"&gt;###Get parameters as variables&lt;/SPAN&gt;
inputshp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
ouputDest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
outputName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###Copy shapefile to feature class in Default.gdb and add a field called WKT&lt;/SPAN&gt;
intFC &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureClassToFeatureClass_conversion&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; inputshp&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"intFC"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_table &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; intFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WKT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_length &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;100000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###Populate WKT column with WKT geometery&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"WKT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@WKT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###Set output folder to output folder as given by user&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outputDest"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###Create xls output&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TableToExcel_conversion &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outputName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###Delete intermittent feature class&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intFC&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Finished"&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the error is:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "S:\Works and Infrastructure Services\Infrastructure and Design\Technical Services\Asset Management\Robin\Python\AddWKT.py", line 25, in &amp;lt;module&amp;gt;&lt;BR /&gt; arcpy.TableToExcel_conversion (intFC, outputName)&lt;BR /&gt; File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\conversion.py", line 81, in TableToExcel&lt;BR /&gt; raise e&lt;BR /&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000814: Invalid file type&lt;BR /&gt;Failed to execute (TableToExcel).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I might be incorrectly referencing the outputName parameter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:15:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321228#M24979</guid>
      <dc:creator>deleted-user-gYtz_UYfIh9y</dc:creator>
      <dc:date>2021-12-11T15:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321229#M24980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok- resolved this as well- for anyone following along, the output name needed to be concatenated with a ".xls"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not to mention I dropped a letter in the initial outputDest variable... whoops. Now I've gotta completely rethink the whole thing as apparently excel output is gonna lead to trouble down the road with any ridiculously long WKT geometries. Thanks everyone for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 22:15:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321229#M24980</guid>
      <dc:creator>deleted-user-gYtz_UYfIh9y</dc:creator>
      <dc:date>2018-10-16T22:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simple python tool for WKT extraction- diagnosing error?</title>
      <link>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321230#M24981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your error says, "Parameters are not valid." So, what are the parameters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outputName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next step, check the help doc and make sure the parameters are exactly the correct data type:&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/conversion/table-to-excel.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/conversion/table-to-excel.htm"&gt;Table To Excel—Conversion toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: the line specifying your workspace is probably wrong.&amp;nbsp;It should be the following, to use the variable value, not the string "outputDest":&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;arcpy&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;outputDest&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To be honest, environment variables are sometimes not worth the hidden trouble they can cause if not used carefully.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 22:18:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-python-tool-for-wkt-extraction-diagnosing/m-p/321230#M24981</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-10-16T22:18:30Z</dc:date>
    </item>
  </channel>
</rss>

