<?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: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp;amp; WGS 1984: Errors 000622 &amp;amp; 000 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559611#M43770</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks to me like you've got 'extra' columns defined in your Excel worksheet for the table, even though they are blank....so when processing they automatically get written.&amp;nbsp; Change this by 'redefining' the range in Excel.&amp;nbsp; Also, I think an easy way is to define the print range which shows up as a separate 'table' in ArcGIS, so you can use that too.&amp;nbsp; Any questions, you can experiment with defining ranges in Excel to see how that in turn is read in ArcGIS...just be careful with file locking.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, looks like you are pretty much there with what I'd call successful output!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&amp;nbsp; By the way, thanks to Arek for the provided code that answers your basic initial question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to use a text file instead, you can look into that later - not sure the tools such as Make XY Event Layer work as well (or directly) with text files.&amp;nbsp; Incidentally (if this is more convenient), as in 'intermediary' agent, you can use Excel to read native text data formatted in a saved xls (or xlsx, etc.) which in turn can be read directly by ArcGIS - no need to change the script you are now using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As far as the 'infile' text file code in the sample, the reading of the file is done line by line using Python's methods from 'fileinput' module (not using arcpy's search cursor).&amp;nbsp; Going this route will involve dealing directly with the input file's structure, the delimiter used, parsing the strings into appropriate variables, etc.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Oct 2012 13:49:58 GMT</pubDate>
    <dc:creator>T__WayneWhitley</dc:creator>
    <dc:date>2012-10-31T13:49:58Z</dc:date>
    <item>
      <title>ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp;amp; WGS 1984: Errors 000622 &amp;amp; 000628?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559604#M43763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Excel 2007, I created a .csv file of the XY-coordinates for 10 points of my sampling locations at Edgewood, Maryland - see the attached file.&amp;nbsp; In the Python Window of my ArcGIS 10.0, I executed the following Python script: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;gt;&amp;gt;&amp;gt; # scMakeXYlayer.py&amp;nbsp;&amp;nbsp; for 12 points&amp;nbsp; Just X- &amp;amp; Y-coord, but no Z-coord in the csv &amp;amp; the .py file
... # Description: Creates an XY layer and exports it to a layer file
... # Author: ESRI - modified by Scott Chang per Chris Thompson's New No-Z (Date:&amp;nbsp; 16 Oct 2012)
... # import system modules 
... import arcpy
... from arcpy import env
... # Set environment settings
... env.workspace = 'C:\TEMP\BS_Test.gdb'
...&amp;nbsp; 
... try:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the local variables
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # in_Table = "firestations.csv"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = r'C:\TEMP\WritingGeometries\APGriMMRP.csv'
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xc = "X"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yc = "Y"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_Layer = "BHsWellLocations_layer"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; saved_Layer = r"c:\TEMP\BHsWellLocations.lyr"
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the spatial reference
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 11N.prj"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984" 
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Make the XY event layer...
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Print the total rows
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetCount_management(out_Layer)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save to a layer file
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)
...&amp;nbsp; 
... except:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred print the message to the screen
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()
... 
ERROR 000622: Failed to execute (Make XY Event Layer). Parameters are not valid.
ERROR 000628: Cannot set input into parameter spatial_reference.
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please kindly help and advise me why I got these 2 errors and how to fix them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2012 11:23:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559604#M43763</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2012-10-16T11:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559605#M43764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at attached file, I think coordinates format is invalid. To create features in WGS coordinates have to be in decimal degrees and in your file they aren't.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Another thing is what you want to achieve by creating lyr on event layer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to save event layer as featureclass use CopyFeatuers_management instead.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2012 13:11:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559605#M43764</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2012-10-16T13:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559606#M43765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Arek,&amp;nbsp; Thanks for your nice response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1)&amp;nbsp; I used the UTM &amp;lt;=&amp;gt; Lat/Long Decimal Degrees converter to change the X,Y-coordinates of 10 points in UTM Zone 18 (NAD 83) to the new X,Y-coordinates of same 10 points in World WGS 1984 - see the attached xls file. Then I executed my scMakeXYlayer.py in the Python Window of my ArcGIS 10.0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; # scMakeXYlayer.py&amp;nbsp;&amp;nbsp; for 10 points at APG-RI-MMRP site&amp;nbsp; 
... # WGS 1984: X- &amp;amp; Y-coord, but no Z-coord in the csv &amp;amp; the .py file
... # Description: Creates an XY layer and exports it to a layer file
... # Author: ESRI - modified by Scott Chang per Chris Thompson's New No-Z (Date:&amp;nbsp; 17 Oct 2012)
... # import system modules 
... import arcpy
... from arcpy import env
... # Set environment settings
... env.workspace = 'C:\TEMP\BS_Test.gdb'
...&amp;nbsp; 
... try:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the local variables
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # in_Table = "firestations.csv"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = r'C:\TEMP\WritingGeometries\ApgRImmrpWGS.csv'
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xc = "X"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yc = "Y"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_Layer = "BHsWellEdgewood_layer"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; saved_Layer = r"c:\TEMP\BHsWellEdgewood.lyr"
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the spatial reference
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 18N.prj"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984.prj" 
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Make the XY event layer...
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Print the total rows
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetCount_management(out_Layer)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save to a layer file
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)
...&amp;nbsp; 
... except:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred print the message to the screen
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()
... 
ERROR 000622: Failed to execute (Make XY Event Layer). Parameters are not valid.
ERROR 000628: Cannot set input into parameter spatial_reference.
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I got the same Errors 000622 and 000628 again.&amp;nbsp;&amp;nbsp; I wonder why my scMakeXYlayer.py with the "UTM" XY-coordinates worked before, but my new shcMakeXYlayer.py with the "World WGS 1984" XY-coordinates did not work!!!???&amp;nbsp; Please kindly help and enlighten me on this strange matter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2)&amp;nbsp; I don't understand your second thing you mentioned and I don't know how to implement it.&amp;nbsp; Please give me the detailed instructions of writing the Python code for doing it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:09:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559606#M43765</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2021-12-12T00:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559607#M43766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I made few changes to your code and test it with xls you've attached, and it seems to be working fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You may want to check is everything is ok with your wgs 84.prj, and path to it. Also i recommend to skip setting env, unless you wanne use it. Below code with my modifications, also should explain how to use CopyFeatures instead of SaveToLayerFile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

import arcpy
from arcpy import env
# Set environment settings
#env.workspace = 'C:\TEMP\BS_Test.gdb'
 
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the local variables
&amp;nbsp;&amp;nbsp;&amp;nbsp; # in_Table = "firestations.csv"
&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = 'D:\\ApgRImmrpWGS.xls\\ApgRImmrpWGS$'
&amp;nbsp;&amp;nbsp;&amp;nbsp; xc = "X"
&amp;nbsp;&amp;nbsp;&amp;nbsp; yc = "Y"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_Layer = "BHsWellLocations_layer"
&amp;nbsp;&amp;nbsp;&amp;nbsp; saved_Layer = r"c:\Tmp\BHsWellLocations.shp"
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the spatial reference
&amp;nbsp;&amp;nbsp;&amp;nbsp; # spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 11N.prj"
&amp;nbsp;&amp;nbsp;&amp;nbsp; spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984" 
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Make the XY event layer...
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef)
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Print the total rows
&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetCount_management(out_Layer)
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save to a layer file
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(out_Layer, saved_Layer)
 
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred print the message to the screen
&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:09:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559607#M43766</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2021-12-12T00:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559608#M43767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Arek, Thanks for your nice response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I modified my Python script as you instructed to do CopyFeatures. In the Python Window of my ArcGIS 10.0 (Desktop), I executed the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; # scMakeXYlayer.py&amp;nbsp;&amp;nbsp; for 12 points&amp;nbsp; Just X- &amp;amp; Y-coord, but no Z-coord in the csv &amp;amp; the .py file
... # Description: Creates an XY layer and uses CopyFeatures to save it to a layer file
... # Author: ESRI - modified by Scott Chang per Arkadiusz Matoszka (Date:&amp;nbsp; 24 Oct 2012)
... # import system modules 
... import arcpy
... from arcpy import env
... # Set environment settings
... # env.workspace = 'C:\TEMP\BS_Test.gdb'&amp;nbsp; # New!!!
...&amp;nbsp; 
... try:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the local variables
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # in_Table = "firestations.csv"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = 'C:\TEMP\WritingGeometries\arekAPGriMMRP.xls\APGriMMRP$'
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xc = "X"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yc = "Y"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_Layer = "Pointlocations_layer"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; saved_Layer = r"c:\TEMP\arekAPGriMMRPLocations.shp" # not .layer!!!
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the spatial reference
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 11N.prj"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984" 
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Make the XY event layer...
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Print the total rows
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetCount_management(out_Layer)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save to a layer file
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(out_Layer, saved_Layer) # New!!!
... except:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred print the message to the screen
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()
... 
Executing: MakeXYEventLayer C:\TEMP\WritingGeometries rekAPGriMMRP.xls\APGriMMRP$ X Y Pointlocations_layer "PROJCS['NAD_1983_UTM_Zone_11N',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-117.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5120900 -9998100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision" #
Start Time: Wed Oct 24 08:12:45 2012
Failed to execute. Parameters are not valid.
ERROR 000732: XY Table: Dataset C:\TEMP\WritingGeometries rekAPGriMMRP.xls\APGriMMRP$ does not exist or is not supported
Failed to execute (MakeXYEventLayer).
Failed at Wed Oct 24 08:12:45 2012 (Elapsed Time: 0.00 seconds)
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know why it does not work for me. I have ArcGIS Desktop 10.0 - it is not a very sophiscated version of ArcGIS 10 (I feel). I wonder: Did you use a more sophiscated/advanced version of ArcGIS 10 system to do your "CopyFeatures" Python programming? I really like to use the xls file and the "CopyFeatures" code staement to do the "Make XY Event Layer" Python programming like the manual way to get the "Point" featurs. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please kindly help and advise again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:09:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559608#M43767</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2021-12-12T00:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559609#M43768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your problem is not with Copy Features but with reading the table pathname for Make XY Event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You have done this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; tb = 'C:\TEMP\WritingGeometries\arekAPGriMMRP.xls\APGriMMRP$'

&amp;gt;&amp;gt;&amp;gt; # which returns a faulty pathname because '\' is read as an escape character by Python
&amp;gt;&amp;gt;&amp;gt; print tb
C:\TEMP\WritingGeometriesrekAPGriMMRP.xls\APGriMMRP$
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...and should have followed the sample given you by Arek more closely since it is easy to make a minor error to foul the whole works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; # as given you by arekmatoszka: 
&amp;gt;&amp;gt;&amp;gt; tb = 'C:\\TEMP\\WritingGeometries\\arekAPGriMMRP.xls\\APGriMMRP$'

&amp;gt;&amp;gt;&amp;gt; print tb
C:\TEMP\WritingGeometries\arekAPGriMMRP.xls\APGriMMRP$


&amp;gt;&amp;gt;&amp;gt; # or do this:
&amp;gt;&amp;gt;&amp;gt; tb = r'C:\TEMP\WritingGeometries\arekAPGriMMRP.xls\APGriMMRP$'

&amp;gt;&amp;gt;&amp;gt; print tb
C:\TEMP\WritingGeometries\arekAPGriMMRP.xls\APGriMMRP$
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:09:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559609#M43768</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-12T00:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559610#M43769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Wayne,&amp;nbsp; Thanks for your nice response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) I corrected my mistake in tb = r"C:\TEMP\...\...xls\ApgRImmrpWGS$" as you pointed out. It worked and I got the right output and Map. But, in addition to ID, Pt_ID, X, Y, I saw there are&amp;nbsp; blank F5, F6 and F7 columns that appear in the Attribute Table also - see the attached file.&amp;nbsp;&amp;nbsp; I don't know why they (i.e. blank F5, F6 and F7) appear in the Attribute Table. Can you tell me how I can avoid them to appear in the Attribute Table?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Can I use the .txt file for input of ID, Pt_ID, X, Y via tb = r"C:\TEMP\....txt\...?&amp;nbsp; If it can be done this way, please give me the detailed code statement for&amp;nbsp; tb = r"C:\TEMP\....txt\...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please kindly help and respond again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S.&amp;nbsp; In doing "WritingGeometries" ArcPy-Python programming before, I used the following code blindly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;infile = r"C:\TEMP\WritingGeometries\WritingGeometries_12Points.txt"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did/do not understand "infile" at all.&amp;nbsp; Could you please enlighten me on infile and its usage for me?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2012 13:14:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559610#M43769</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2012-10-31T13:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559611#M43770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks to me like you've got 'extra' columns defined in your Excel worksheet for the table, even though they are blank....so when processing they automatically get written.&amp;nbsp; Change this by 'redefining' the range in Excel.&amp;nbsp; Also, I think an easy way is to define the print range which shows up as a separate 'table' in ArcGIS, so you can use that too.&amp;nbsp; Any questions, you can experiment with defining ranges in Excel to see how that in turn is read in ArcGIS...just be careful with file locking.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, looks like you are pretty much there with what I'd call successful output!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&amp;nbsp; By the way, thanks to Arek for the provided code that answers your basic initial question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to use a text file instead, you can look into that later - not sure the tools such as Make XY Event Layer work as well (or directly) with text files.&amp;nbsp; Incidentally (if this is more convenient), as in 'intermediary' agent, you can use Excel to read native text data formatted in a saved xls (or xlsx, etc.) which in turn can be read directly by ArcGIS - no need to change the script you are now using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As far as the 'infile' text file code in the sample, the reading of the file is done line by line using Python's methods from 'fileinput' module (not using arcpy's search cursor).&amp;nbsp; Going this route will involve dealing directly with the input file's structure, the delimiter used, parsing the strings into appropriate variables, etc.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2012 13:49:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559611#M43770</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2012-10-31T13:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559612#M43771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Wayne,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) I went to the "Home" manu =&amp;gt; clicked on "Clear" to delete F5, F6 and F7 columnns of my xls file. Then I saved it and I executed the Python script in the Python Window of my ArcGIS 10.0.&amp;nbsp; It worked and I got the right output without the blank F5, F6 and F7 columns in the Attribute Table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) I added a new column "Z" and the values for the 10 points.&amp;nbsp; Then I executed the newly revised script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; # scMakeXYlayer.py&amp;nbsp;&amp;nbsp; for 10 points of ApgRImmrp:&amp;nbsp;&amp;nbsp; X-, Y-, and Z-coord in the xls &amp;amp; the .py file
... # Description: Creates an XY layer and uses CopyFeatures to save it to a layer file
... # Author: ESRI - modified by Scott Chang per Arkadiusz Matoszka &amp;amp; Wayne Whitley (Date:&amp;nbsp; 31 Oct 2012)
... # import system modules 
... import arcpy
... from arcpy import env
... # Set environment settings
... # env.workspace = r"C:\TEMP\BS_Test.gdb"&amp;nbsp; # New!!!
...&amp;nbsp; 
... try:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the local variables
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # in_Table = "firestations.csv"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = r"C:\TEMP\WritingGeometries\ApgRImmrpWGS.xls\ApgRImmrpWGS$"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xc = "X"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yc = "Y"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zc = "Z"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_Layer = "Pointlocations_layer"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; saved_Layer = r"c:\TEMP\APGriMMRPBHsWell.shp" # not .layer!!!
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the spatial reference
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 11N.prj"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984" 
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Make the XY event layer...
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Print the total rows
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetCount_management(out_Layer)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save to a layer file
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(out_Layer, saved_Layer) # New!!!
... except:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred print the message to the screen
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()
... 
Executing: MakeXYEventLayer C:\TEMP\WritingGeometries\ApgRImmrpWGS.xls\ApgRImmrpWGS$ X Y Pointlocations_layer "PROJCS['NAD_1983_UTM_Zone_11N',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-117.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5120900 -9998100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision" #
Start Time: Wed Oct 31 13:31:34 2012
Failed to execute. Parameters are not valid.
ERROR 000725: Layer Name or Table View: Dataset Pointlocations_layer already exists.
Failed to execute (MakeXYEventLayer).
Failed at Wed Oct 31 13:31:34 2012 (Elapsed Time: 0.00 seconds)
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It did not work at all. I am lost now.&amp;nbsp; Please help and advise again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:09:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559612#M43771</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2021-12-12T00:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559613#M43772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Wayne,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to use the right spRef=r"........\World\WGS 1984" and arcpy.MakeXYEventLayer_management(tb, xc, yc, zc, out_layer, spRef):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; # scMakeXYlayer.py&amp;nbsp;&amp;nbsp; for 10 points of ApgRImmrp:&amp;nbsp;&amp;nbsp; X-, Y-, and Z-coord in the xls &amp;amp; the .py file
... # Description: Creates an XY layer and uses CopyFeatures to save it to a layer file
... # Author: ESRI - modified by Scott Chang per Arkadiusz Matoszka &amp;amp; Wayne Whitley (Date:&amp;nbsp; 31 Oct 2012)
... # import system modules 
... import arcpy
... from arcpy import env
... # Set environment settings
... # env.workspace = r"C:\TEMP\BS_Test.gdb"&amp;nbsp; # New!!!
...&amp;nbsp; 
... try:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the local variables
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # in_Table = "firestations.csv"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = r"C:\TEMP\WritingGeometries\ApgRImmrpWGSxyz.xls\ApgRImmrpWGS$"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xc = "X"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yc = "Y"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zc = "Z"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_Layer = "Pointlocations_layer"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; saved_Layer = r"c:\TEMP\APGriMMRPBHsWellZ.shp" # not .layer!!!
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the spatial reference
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 11N.prj"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984" 
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Make the XY event layer...
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeXYEventLayer_management(tb, xc, yc, zc, out_Layer, spRef)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Print the total rows
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetCount_management(out_Layer)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save to a layer file
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(out_Layer, saved_Layer) # New!!!
... except:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred print the message to the screen
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()
... 
ERROR 000622: Failed to execute (Make XY Event Layer). Parameters are not valid.
ERROR 000628: Cannot set input into parameter spatial_reference.
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got the new errors: Errors 000622 &amp;amp; 000628!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help and advise again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:09:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559613#M43772</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2021-12-12T00:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559614#M43773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The order of parameters from the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000006z000000"&gt;help &lt;/A&gt;&lt;SPAN&gt;is (note that the z-field is last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MakeXYEventLayer_management (table, in_x_field, in_y_field, out_layer, {spatial_reference}, {in_z_field})&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, your call should be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef, zc)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2012 21:13:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559614#M43773</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-10-31T21:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559615#M43774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Darren,&amp;nbsp; Thanks for your valuable response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I followed your instruction and added the "zc" to the last place of arcpy.MakeXYEventLayer_management(....., zc). I also checked my .xls file for the "zc" data, etc. - see the attched .xls file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I executed my revised Python script in the Python Window of my ArcGIS 10.0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; # scMakeXYlayerZ.py&amp;nbsp;&amp;nbsp; for 10 points of ApgRImmrp:&amp;nbsp;&amp;nbsp; X-, Y-, and Z-coord in the xls &amp;amp; the .py file
... # Description: Creates an XY layer and uses CopyFeatures to save it to a layer file
... # Author: ESRI - modified by Scott Chang per Arkadiusz Matoszka, Wayne Whitley and Darren Wiens 
... # (Date:&amp;nbsp; 1 Nov 2012)
... # import system modules 
... import arcpy
... from arcpy import env
... # Set environment settings
... # env.workspace = r"C:\TEMP\BS_Test.gdb"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # New!!!&amp;nbsp; (per Arek)
...&amp;nbsp; 
... try:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the local variables
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # in_Table = "firestations.csv"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = r"C:\TEMP\WritingGeometries\ApgRImmrpWGSxyz.xls\ApgRImmrpWGS$"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xc = "X"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yc = "Y"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zc = "Z"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_Layer = "Pointlocations_layer"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; saved_Layer = r"c:\TEMP\APGriMMRPBHsWellZ.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # not .layer!!!
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set the spatial reference
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 11N.prj"
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984" 
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Make the XY event layer...
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef, zc)&amp;nbsp; # zc should be last (per Darren)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Print the total rows
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetCount_management(out_Layer)
...&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save to a layer file
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(out_Layer, saved_Layer)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # New!!! (per Arek)
... except:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred print the message to the screen
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()
... 
ERROR 000622: Failed to execute (Make XY Event Layer). Parameters are not valid.
ERROR 000628: Cannot set input into parameter spatial_reference.
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It did not work at all-ERRORS 000622 and 000628 again.&amp;nbsp; Please kindly help and advise again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:09:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559615#M43774</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2021-12-12T00:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559616#M43775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Uh, this might sound uninformed, but I'm just curious - does the WGS84 coord sys even support Z coordinates?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apparently, yes.&amp;nbsp; Just tested this with WGS 84, using lat/lon points, 4 of them with the Make XY Event Layer Z parameter ranging from -25 to 25.&amp;nbsp; Probably meters is assumed, I'm not certain and haven't tested much at all with this.&amp;nbsp; It may depend on whether you've defined your vertical datum (if you have one).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 13:22:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559616#M43775</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2012-11-01T13:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559617#M43776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like there's a problem with how you're specifying your coordinate system. Apparently, there are 3 ways to properly create a &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/SpatialReference/018z0000000v000000/"&gt;spatial reference&lt;/A&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1.) Use the name of the coordinate system (I couldn't get it to work with "GCS_WGS_1984" or "WGS_1984", so I'm not sure what it's looking for)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) Use a projection file (.prj) (I didn't try this)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3.) Use a coordinate system's factory code (or authority code) (this works)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try making spRef = 4326&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.MakeXYEventLayer_management("H:/GIS_Data/ApgRImmrpWGSxyz.xls/ApgRImmrpWGS$", "X", "Y", "outputlayer",4326, "Z")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 14:45:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559617#M43776</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-11-01T14:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559618#M43777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Darren, Thanks for your nice and valuable response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I revised the input information in the arcpyMakeXYEventLayer_management(....) as you instructed. Then I executed my revised Python script in the Python Window of my ArcGIS 10.0 - see the attached docx file. It worked. But It gave me (i) outputlayer only, (ii) no out_Layer and saved_Layer, and (iii) ERROR 000732.&amp;nbsp; I think that (i), (ii) and (iii) can be improved/corrected. Please kindly help and advise me how to improve/correct (i), (ii) and (iii).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 17:15:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559618#M43777</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2012-11-01T17:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559619#M43778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm sorry for your pain - but you've introduced a new layer name as output, "outputlayer".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Naturally this is going to 'break the chain'.&amp;nbsp; You using 2 more tools trying to access out_Layer (a variable reference to "Pointlocations_layer")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your fix should be to ust the out_Layer variable (no quotes).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 17:26:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559619#M43778</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2012-11-01T17:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559620#M43779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Wayne, Thanks for your nice, valuable response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed the "outputlayer" to out_Layer as you instructed.&amp;nbsp; I executed the newly revised Python script.&amp;nbsp; It worked beautifully.&amp;nbsp; I got no errors and 2 right output/Layers&amp;nbsp; (APGriMMRPBHsWellZ and Pointlocation_layer) in TOC-see the attached file.&amp;nbsp; One final questions to ask you: I guess that APGriMMRPBHsWellZ is a shapfile and Pointlocation_layer is NOT a shapefile (just a layer). Do I guess it right? Why are they different? How can I tell the difference between these 2 output?&amp;nbsp;&amp;nbsp; Please help and respond.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 18:54:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559620#M43779</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2012-11-01T18:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559621#M43780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, you guessed right...the one with the shp file extension is the shapefile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The main difference is shapefile or feature class, etc. is stored separate from your map.&amp;nbsp; A 'feature layer' (and a 'table view') are 'virtual' -- they can be added to your map but essentially when your map is deleted, or when your ArcGIS session is ended either without saving or without the option to 'add outputs to display', then the output is lost.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's basically it - usually it's better to save data outside the map doc so at least you can access it from another doc, if you wish.&amp;nbsp; At the very least, although you shouldn't be losing mxds, data tends to be safer in a shapefile library or in gdb(s).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps.&amp;nbsp; And hope you're keeping your sense of humor working through some of these problems.&amp;nbsp; Now, make sure you award points to everyone who helped you!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 19:14:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559621#M43780</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2012-11-01T19:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559622#M43781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Wayne, Thanks for your response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know how I can award the points to everyone who helped me in this Make XY Layer Event Python pergramming.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Chang&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 11:26:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559622#M43781</guid>
      <dc:creator>ScottChang</dc:creator>
      <dc:date>2012-11-05T11:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv &amp; WGS 1984: Errors 000622 &amp; 000</title>
      <link>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559623#M43782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See what I will call the 'toggle button' over to the upper right of the post - fiddle with that, up arrow awards points....&amp;nbsp; I forget exactly how you 'check mark' a response for the answer but you can probably figure it out (or maybe in FAQ?) - thing is, I believe you can only award 1 correct answer.&amp;nbsp; Points, on the other hand, can be applied 'sprinkling' onto several posts, if you will.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for participating and keeping us on our toes!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Wayne&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&amp;nbsp; See the pic at the top of the page:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/index.php"&gt;http://forums.arcgis.com/index.php&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 17:56:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis10-0-pythonwindow-make-xy-event-layer-csv/m-p/559623#M43782</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2012-11-05T17:56:19Z</dc:date>
    </item>
  </channel>
</rss>

