ArcGIS 10.1:Using XYZ coordinates to do MakeXYlayer-Runtime Error 000732. Why?

784
5
01-22-2013 05:05 AM
ScottChang
New Contributor II
Hi all,
I have the following Excel .xls file:
ID    Pt_ID        X                 Y               Z
1     BH1          -76.301725   39.392986    0.1
2     BH2          -76.300981   39.392928    0.2
3     BH3          -76.301694   39.392611    0.3
.      .....          ..............     ............     ....
9     BH9          -76.331157   39.396452    0.9
10   Well1        -76.332654    39.395984   1.1

I executed the following Python-ArcPy script:
# import system modules 
import arcpy
from arcpy import env

# Set environment settings
# env.workspace = r"C:\TEMP\BS_Test.gdb"  # New!!!
 
try:
    # Set the local variables
    # in_Table = "firestations.csv"
    tb = r"C:\TEMP\WritingGeometries\ApgRImmrpWGS.xls\ApgRImmrpWGS$"
    xc = "X"
    yc = "Y"
    zc = "Z"

    out_Layer = "Pointlocations_layer"
    saved_Layer = r"c:\TEMP\APGriMMRPBHsWell.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)
 
    # 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!!!

except:
    # If an error occurred print the message to the screen
    print arcpy.GetMessages()


in my newly installed ArcGIS 10.1 and I got Error 000732 - see the attached file for detals. 

Please kindly help and tell me where I made mistakes and how to resolve this problems.

Thanks,
Scott Chang
Tags (2)
0 Kudos
5 Replies
AdamGuo
New Contributor II
You might have the same problem as I had. Are you running 64bit?

Try and create a batch file: Change C:\YourScriptLocation.py to the location of your script. And run the batch file.
C:\python27\ArcGIS10.1\python.exe C:\YourScriptLocation.py
0 Kudos
ScottChang
New Contributor II
Hi Adam,  Thanks for your nice response.

I used to execute the Python-ArcPy scripts in the Python Window of ArcGIS 10.0 before.  I just had the ArcGIS 10.1 installed recently. I don't know the answer of your question regarding to: Are you running 64 bits? I guess my Computer Team installed the 32 bits of ArcGIS 10.1 in my "Windows 7" PC that is part of Microsoft NT 4 LAN System.  I just "LOAD" the script to the Python Window of ArcMAP (.mxd) of my new ArcGIS 10.1  to run.   I saw the following new thing in my ArcGIS 10.1:  C:\Users\e1enxshc\Documents\ArcGIS\Default.gdb.  I have no ideas about this C:\Users... folder!!??   I don't understand your Code: C:\python27\ArcGIS10.1\python.exe C:\YourScriptLocation.py.  Could you please explain what it is for me?

Please help and respond again.

Thanks,
Scott Chang
0 Kudos
AdamGuo
New Contributor II
It's probably easier if you read the thread below. I ran and posted the same error you had and started that thread. The solution should be in there for you.

http://forums.arcgis.com/threads/75735-Make-XY-Event-Layer-in-Python-Crashes-But-Not-in-Model-Builde...
0 Kudos
ScottChang
New Contributor II
Hi Adam,

I broght both the Data file and the Python script to the same C:\Temp folder and used the "Start" => ArcGIS\ Python 2.7.2\IDLE(Python GUI) place to execute my Python-ArcPy script.   I got the same Error 000732 - see the newly attached file for details. On the top of this Error Message, I saw "Python 2.7.2 (default, Jan 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32" - Does it mean it runs on 64 bit?  Please help and respond on this strange error.

Thanks,
Scott Chang
0 Kudos
ScottChang
New Contributor II
Hi Adam and new ArcGIS 10.1 Users,

Per ESRI Technical Support, "Python 2.7.2 (defult, Jan 12, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32" shown in the IDLE Python (GUI) was wrong in my ArcGIS 10.1 installed originally. My wrong ArcGIS 10.1 installed originally was deleted and a new ArcGIS 10.1 was downloaded from an ESRI source and installed in my "Windows 7" PC.  I ran my old Python-ArcPy script on the new IDLE Python (GUI) that shows "Python 2.7.2 (default June 12, 2011.15:00:59) [MSC v.1500 32 bit (Intel)] on win 32" successfully without any errors!!!!  I just want to tell you and new ArcGIS 10.1 Users this important thing in executing the Python-ArcPy scripts for Make XY Event Layer.

Scott Chang
0 Kudos