Solved! Go to Solution.
#Import arcpy module import arcpy, os # Set the workspace environment to local file geodatabase arcpy.env.workspace = ws = r"C:\FoB Oil and Gas\GoM\WorkSpace.gdb" spa_ref = r'C:\Program Files (x86)\ArcGIS\Desktop10.0\Coordinate Systems\Geographic Coordinate Systems\North America\NAD 1927.prj' try: # Local variables: tbl = r"C:\FoB Oil and Gas\GoM\3_Compare\Compare.mdb\WELLS" lyr = "WELLS_Layer" # Process: Make XY Event Layer arcpy.MakeXYEventLayer_management(tbl, "SURFACE_LONGITUDE", "SURFACE_LATITUDE", lyr, spa_ref) # Print the total rows print arcpy.GetCount_management(lyr) arcpy.FeatureClassToFeatureClass_conversion(lyr, ws, 'WELLS_Points') print 'Created Feature Class' except: tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] pymsg = "PYTHON ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n\t" + \ str(sys.exc_type) + ": " + str(sys.exc_value) + "\n" msgs = "ARCPY ERRORS:\n" + arcpy.GetMessages(2) + "\n" arcpy.AddError(msgs) arcpy.AddError(pymsg) print msgs print pymsg arcpy.AddMessage(arcpy.GetMessages(1)) print arcpy.GetMessages(1)
sr = arcpy.SpatialReference(factoryCode)
Where factoryCode is the WKID (well-known ID), that isn't so well known (just a small joke there, sorry). Maybe wrong, but this may set if correctly for you:
sr = arcpy.SpatialReference(104145)
# Process: Make XY Event Layer, WKID 4267 is NAD 1927 in 10.1 arcpy.MakeXYEventLayer_management(tbl, "SURFACE_LONGITUDE", "SURFACE_LATITUDE", lyr, 4267)