Hi Darren, Thanks for your valuable response.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.I executed my revised Python script in the Python Window of my ArcGIS 10.0:>>> # scMakeXYlayerZ.py for 10 points of ApgRImmrp: X-, Y-, and Z-coord in the xls & 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: 1 Nov 2012)
... # import system modules
... import arcpy
... from arcpy import env
... # Set environment settings
... # env.workspace = r"C:\TEMP\BS_Test.gdb" # New!!! (per Arek)
...
... try:
... # Set the local variables
... # in_Table = "firestations.csv"
... tb = r"C:\TEMP\WritingGeometries\ApgRImmrpWGSxyz.xls\ApgRImmrpWGS$"
... xc = "X"
... yc = "Y"
... zc = "Z"
... out_Layer = "Pointlocations_layer"
... saved_Layer = r"c:\TEMP\APGriMMRPBHsWellZ.shp" # not .layer!!!
...
... # Set the spatial reference
... # spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 11N.prj"
... spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984"
...
... # Make the XY event layer...
... arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef, zc) # zc should be last (per Darren)
...
... # Print the total rows
... print arcpy.GetCount_management(out_Layer)
...
... # Save to a layer file
... # arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)
... arcpy.CopyFeatures_management(out_Layer, saved_Layer) # New!!! (per Arek)
... except:
... # If an error occurred print the message to the screen
... 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.
>>>
It did not work at all-ERRORS 000622 and 000628 again. Please kindly help and advise again.Thanks in advance,Scott Chang