|
POST
|
There have been several posts with this issue in the past with various resolutions. Here are a few. http://forums.arcgis.com/threads/75397-Error-Cannot-get-exclusive-schema-lock http://forums.arcgis.com/threads/66584-repeated-AddField-operations-fails-in-10.1-works-in-10.0
... View more
02-19-2013
10:18 AM
|
0
|
0
|
1124
|
|
POST
|
This is not a parameter that can currently be modified directly via arcpy. You would have to create a layer file with the desired symbology and set your target layer to use that symbology.
... View more
02-19-2013
04:36 AM
|
0
|
0
|
603
|
|
POST
|
That error seems to indicate you are not selecting anything or your selection is not valid. Have you checked to see if you actually select anything using .getOuput() or .FIDSet? Have you tried doing this process manually in ArcMap?
... View more
02-19-2013
04:23 AM
|
0
|
0
|
2584
|
|
POST
|
You have this set to a static scale. Is this not the result you are getting? df.scale = 8000 You could also try isolating the layer to make sure there aren't any other selections. df.extent = lyr.getSelectedExtent()
... View more
02-18-2013
07:15 AM
|
0
|
0
|
2584
|
|
POST
|
I would make a few minor changes. If your list is coming in as a string for whatever reason you can just do this to make it an actual list. masterlist = masterlist.split(',') Then in your loop you can just do this. if fc in masterlist:
print('{0} has {1} features'.format(fc, fcrecs))
dcount[fc] += fcrecs
... View more
02-13-2013
01:31 PM
|
0
|
0
|
3285
|
|
POST
|
Wayne has the right idea I think, incrementing a dict counter with fc name as the key would be fairly easy. You can be a little more concise than the posted example. for i in range(10):
fcNames['fc1'] += 1
... View more
02-13-2013
12:03 PM
|
0
|
0
|
3285
|
|
POST
|
I'd recommend reinstalling python/ArcGIS first. How much longer does it run unresponsive on your problem PC than when it is run successfully? When it is not responding is the process still utilizing the CPU? If so is it a constant CPU percentage or does it fluctuate?
... View more
02-13-2013
06:01 AM
|
0
|
0
|
1727
|
|
POST
|
I do not believe this issue exists in versions 10.0 and above. The only issue I've seen is when mapping large datasets if the optional parameters are not set a sample of the data will be taken to determine what they are, if the sample doesn't get to a large enough numeric value or a long enough string you could run into errors when defaults are assigned.
... View more
02-13-2013
05:07 AM
|
0
|
0
|
870
|
|
POST
|
I assume you are talking about string methods, split, strip, replace, etc. http://docs.python.org/2/library/stdtypes.html#string-methods
... View more
02-12-2013
12:49 PM
|
0
|
0
|
3080
|
|
POST
|
Did you save the script after you commented out the line? It works in 10.0, in 10.1 it seems the ability to modify system scripts directly has been disabled.
... View more
02-12-2013
11:00 AM
|
0
|
0
|
1885
|
|
POST
|
They are generated from the script you are calling. You can edit the script or create a new one and import it separately. If you edit the script directly I suggest you make a copy just in case. Here is the line to edit. ConversionUtils.gp.AddMessage("%s %s %s" % (inFeatureClass, msgSuccess, outFeatureClass))
... View more
02-11-2013
10:04 AM
|
0
|
0
|
1885
|
|
POST
|
You should just need to add this after your selection. arcpy.RefreshActiveView() I made a few other changes if you are interested. #import modules and define workspace
import arcpy
import os
import traceback
workspace = arcpy.env.workspace = r"C:/temp"
print workspace
arcpy.env.overwriteOutput = True
#Define map document
mxDoc = arcpy.mapping.MapDocument(r"C:/temp/PSL_Parcel.mxd")
print mxDoc
#List the first dataframe (named Layers) in the map document
df = arcpy.mapping.ListDataFrames(mxDoc, "Layers")[0]
#List first map layer (which is the parcels layer) in dataframe
parcelLayer = arcpy.mapping.ListLayers(mxDoc,"",df)[0]
print parcelLayer
parcelField = "APN_NU_1"
#Create a feature layer to make selections on
selectingLayer = arcpy.MakeFeatureLayer_management(parcelLayer, "parcelLayer_lyr")
row, rows = None, None
#Set up cursor:
rows = arcpy.SearchCursor(selectingLayer)
apnList = []
#Find the field, select each record and get values
for row in rows:
apnList.append(row.getValue(parcelField))
for APN in apnList:
print(APN)
whereClause = "APN_NU_1 = '{0}'".format(APN)
arcpy.management.SelectLayerByAttribute(selectingLayer, "NEW_SELECTION", whereClause)
arcpy.RefreshActiveView()
#Export map with selected record to PDF
pdfLocation = 'C:/temp'
pdfName = os.path.join(pdfLocation, APN + '.pdf')
arcpy.mapping.ExportToPDF(mxDoc, pdfName)
print len(apnList)
del row, rows
#Clean up feature layers from memory and to debug and or rerun script
arcpy.Delete_management(selectingLayer)
... View more
02-11-2013
04:14 AM
|
0
|
0
|
978
|
|
POST
|
That is odd, it works for me. Edit: Sorry no, I was using a cursor. rows = arcpy.UpdateCursor(layer)
for row in rows:
var = row.AREAESTIMATED
if var:
row.TAG = 1
else:
row.TAG = 0
rows.updateRow(row)
... View more
02-07-2013
01:40 PM
|
0
|
0
|
1473
|
|
POST
|
I don't believe that level of access is exposed to the arcpy module, that is getting into ArcObjects territory.
... View more
02-07-2013
01:08 PM
|
0
|
0
|
1152
|
|
POST
|
May be a bug, there were a lot of issues with null values in 10.0 I believe. NIM079575 - Field Calculator does not recognize <Null> NIM059424 - Null values in the feature class do not get replaced when using Python in the Field Calculator. NIM086737 - The Select by Attributes tool using "IS NULL" on a joined field does not return selections in ArcGIS 10 SP5. NIM063379 - A Field Calculator error dialog opens in PythonWin for an assignment of a null value to a text field in a shapefile. I believe this was the work around. def i(x):
var = x
if var:
return "Used to be Null"
else:
return var
... View more
02-07-2013
01:00 PM
|
0
|
0
|
1473
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|