I am getting "keyword can't be an expression" error while running the following code:
>>> import arcpy
>>> arcpy.MakeFeatureLayer_management("Point","P1","Layer" = 'WM-VALVE-ID')
I ran "Make Feature Layer" tool from the toolbox which worked. Below is the python snippet:
arcpy.MakeFeatureLayer_management("Point","Point_Layer","/\Layer/\ = 'WM-VALVE-ID'","#","OBJECTID OBJECTID VISIBLE NONE;Shape Shape VISIBLE NONE;Entity Entity VISIBLE NONE;Handle Handle VISIBLE NONE;Layer Layer VISIBLE NONE;LyrFrzn LyrFrzn VISIBLE NONE;LyrLock LyrLock VISIBLE NONE;LyrOn LyrOn VISIBLE NONE;LyrVPFrzn LyrVPFrzn VISIBLE NONE;LyrHandle LyrHandle VISIBLE NONE;Color Color VISIBLE NONE;EntColor EntColor VISIBLE NONE;LyrColor LyrColor VISIBLE NONE;BlkColor BlkColor VISIBLE NONE;Linetype Linetype VISIBLE NONE;EntLinetype EntLinetype VISIBLE NONE;LyrLnType LyrLnType VISIBLE NONE;BlkLinetype BlkLinetype VISIBLE NONE;Elevation Elevation VISIBLE NONE;Thickness Thickness VISIBLE NONE;LineWt LineWt VISIBLE NONE;EntLineWt EntLineWt VISIBLE NONE;LyrLineWt LyrLineWt VISIBLE NONE;BlkLineWt BlkLineWt VISIBLE NONE;RefName RefName VISIBLE NONE;LTScale LTScale VISIBLE NONE;Angle Angle VISIBLE NONE;ExtX ExtX VISIBLE NONE;ExtY ExtY VISIBLE NONE;ExtZ ExtZ VISIBLE NONE;DocName DocName VISIBLE NONE;DocPath DocPath VISIBLE NONE;DocType DocType VISIBLE NONE;DocVer DocVer VISIBLE NONE;ScaleX ScaleX VISIBLE NONE;ScaleY ScaleY VISIBLE NONE;ScaleZ ScaleZ VISIBLE NONE;ID ID VISIBLE NONE;ID_ ID_ VISIBLE NONE;B_P B_P VISIBLE NONE")
So, when I copied the Python snippet into my code and tried running it, I got another error "ERROR 000230: Failed selecting with /\Layer/\ = 'WM-VALVE-ID' Failed to execute (MakeFeatureLayer)."
Any help is very much appreciated.
Thanks Sam