Hi Lew,
In my experience it works best to save the expression as a variable prior to your select by statement and then call the variable instead of having the expression in the select statement......
selFire = “FIRESTATUS <> ‘Out’”
arcpy.SelectLayerByAttribute_management(layerName, “NEW_SELECTION”,selFire)
Not sure if that will solve your issue or not?
Candice Steinke
GIS/Data Analyst
BC Timber Sales - Kamloops TSO
1265 Dalhousie Drive
Kamloops, BC V2C 5Z5
Phone: 250-371-4450
Fax: 250-371-6565
--
You received this message because you are subscribed to the Google Groups "Python - ARCGIS geoprocessing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geopython+...@googlegroups.com.
To post to this group, send email to geop...@googlegroups.com.
Visit this group at http://groups.google.com/group/geopython.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Pythoneers,
The solution to this was to create a Feature Layer first. I
def selection():
if arcpy.Exists(layerName):
print "Deleting outLayer"
arcpy.DeleteFeatures_management(layerName)
arcpy.MakeFeatureLayer_management(tmp_layername,layerName)
arcpy.SelectLayerByAttribute_management(layerName, "NEW_SELECTION", 'FIRESTATUS <> \'Out\'')
result = int(arcpy.GetCount_management(layerName).getOutput(0))
print "+++++++++++++++++++++++++++++++++++++++++++"
print layerName
print result
print "+++++++++++++++++++++++++++++++++++++++++++"
... Result = 345
Cheers
Lew
--
You received this message because you are subscribed to a topic in the Google Groups "Python - ARCGIS geoprocessing" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geopython/J114eO47jy8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geopython+...@googlegroups.com.
Hi Mike,
I am working on a script right now where I’m trying to delete a FGDB at the end of my process, but I keep running into lock issues.
Can you explain how that would work? Do I have to use Delete_management to first delete all of the feature classes and feature layers associated with the FGDB before it will unlock and allow me to delete it?
Candice Steinke
GIS/Data Analyst
BC Timber Sales - Kamloops TSO
1265 Dalhousie Drive
Kamloops, BC V2C 5Z5
Phone: 250-371-4450
Fax: 250-371-6565
Hi Candice,
A solution is offered by one of the comments in this thread.
http://forums.arcgis.com/threads/7904-Can-t-delete-a-file-GDB-in-Python-Script-Tool
Also, as it appears that you are creating a temporary FGDB, could you not just create it on the E drive and have it automatically deleted at reboot or log-off?
Thanks Mike. I generally try to clean up as I go but I’ve probably missed a few things.......this one seems to only intermittently give me grief so it’s frustrating because one time it works and the next it doesn’t!