|
POST
|
Hi Dave, When a join exists, the field name will change to 'feature class/table name.field name'. So when calling the fields to write to the text file you would need to specify the parcel feature class name. Ex: f.write(str(row.getValue("parcels.OBJECTID")) + ", " + str(row.getValue("parcels.LU_CODE")) + ", " + str(row.getValue("parcels.ZONE_CODE")) + "\n")
... View more
12-05-2011
04:27 AM
|
0
|
0
|
804
|
|
POST
|
Hi Kent, Take a look at the following link about updating statistics. You should update statistics before and after a compress operation, after you add or remove topology rules, and after you have finished importing, loading, or copying data into an ArcSDE geodatabase. Here is a link about rebuilding indexes. If you are using SQL Server Enterprise edition, refer to the following KB article on how to rebuild indexes.
... View more
12-01-2011
05:00 AM
|
0
|
0
|
1182
|
|
POST
|
Hi Dave, Feel free to post your entire block of code. Be sure to wrap it in tags (using # symbol above) to preserve indentation.
... View more
11-30-2011
11:09 AM
|
0
|
0
|
1898
|
|
POST
|
Here was the test scenario: 1. Register SDE feature class as versioned 2. Create attachments for the feature class 3. Add Global IDs to the feature class 4. Create the replica 5. Add an attachment to a feature 6. Synchronize I found that if the attachments are created before you add the Global IDs that when you add the Global IDs to the feature class, the related attachment table will receive a Global ID field as well. If the Global IDs are added before the attachments are created, the related attachment table will need to have Global IDs manually added to it. Check to make sure your feature class and attachments table both have the Global ID field.
... View more
11-30-2011
02:45 AM
|
1
|
0
|
1336
|
|
POST
|
Hi Brad, I could not find any documentation, but after a quick test, this appears to be supported. I was able to replicate an SDE feature class with attachments to another SDE geodatabase. I am running: ArcGIS 10 SP3 ArcSDE 10 SP3 SQL Server 2008 SP1 Are you receiving any error messages?
... View more
11-30-2011
01:44 AM
|
0
|
0
|
1336
|
|
POST
|
There may be an easier way, but I was able to accomplish this by writing each field to the output text file. Ex: import arcpy
from arcpy import env
mxd = arcpy.mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd, "ParcelDF")[0]
Parcels = "parcels"
fc = arcpy.mapping.ListLayers(mxd, Parcels, df)[0]
f = open("Y:\Notification Radius Pkgs\Setup10\Test.txt", 'w')
rows = arcpy.SearchCursor(fc)
for row in rows:
f.write(str(row.getValue("OBJECTID")) + ", " + str(row.getValue("LU_CODE")) + ", " + str(row.getValue("ZONE_CODE")) + "\n")
f.close()
del row, rows
... View more
11-29-2011
02:58 AM
|
0
|
0
|
1898
|
|
POST
|
Instead of using mxd.save, try saving a copy using mxd.saveACopy. Maybe this could be some sort of write permissions error.
... View more
11-28-2011
10:58 AM
|
0
|
0
|
2584
|
|
POST
|
Hi Chris, I was able to get the following to work w/o returning any duplicates: Pre-logic Script def update():
import arcpy, random
mylist = []
x = 1
while x <= 16:
mylist.append(x)
x += 1
x = 1
rows = arcpy.UpdateCursor(r"C:\temp\python\test.gdb\Fires")
for row in rows:
y = random.choice(mylist)
row.Sample = y
val = row.Sample
mylist.remove(y)
del row, rows
return val
... View more
11-28-2011
08:43 AM
|
0
|
0
|
1584
|
|
POST
|
When you granted privileges to USER1, did you use the 'Privileges' geoprocessing tool in ArcToolbox?
... View more
11-28-2011
06:42 AM
|
0
|
0
|
1455
|
|
POST
|
Hi Adrian, What is the name you are specifying when you attempt to import the feature class?
... View more
11-28-2011
06:27 AM
|
0
|
0
|
1019
|
|
POST
|
Hi Dave, You can do this by iterating through each item in your list. Add the following to your script: import arcpy
from arcpy import env
mxd = arcpy.mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd, "ParcelDF")[0]
Parcels = "parcels"
fc = arcpy.mapping.ListLayers(mxd, Parcels, df)[0]
f = open("Y:\Notification Radius Pkgs\Setup10\Test.txt", 'w')
rows = arcpy.SearchCursor(fc, "OBJECTID < 5")
fields = arcpy.ListFields(fc)
record = []
for row in rows:
for field in fields:
if field.type != "Geometry":
##print "%s: Value = %s" % (field.name, row.getValue(field.name))
record.append(row.getValue(field.name))
for item in record:
f.writelines("%s\n" % item)
record = []
f.close()
del row, rows
... View more
11-28-2011
05:46 AM
|
0
|
0
|
1898
|
|
POST
|
Hi Mike, I could not reproduce this behavior. Try closing ArcMap, execute your script, and then re-open ArcMap and check the layer properties within the Test2.mxd.
... View more
11-28-2011
02:56 AM
|
0
|
0
|
2584
|
|
POST
|
Hi Rich, I believe you are receiving that error because you have a NULL, or empty, value for one of the rows. Perform a search by attribute and then convert all NULL values to 0 and try your script again. Also, you will be able to use the variable in the field calculator.
... View more
11-23-2011
08:17 AM
|
0
|
0
|
1412
|
|
POST
|
Hi Matthias, Here is a code sample. The code grabs the extent from an MXDs data frame, creates an array, and then converts the array to a polygon feature class. import arcpy
from arcpy import env
from arcpy import mapping
env.workspace = r"C:\temp\Test.gdb"
mxd = mapping.MapDocument(r"C:\temp\python\Philadelphia.mxd")
dataframe = mapping.ListDataFrames(mxd, "*")[0]
frameExtent = dataframe.extent
XMAX = frameExtent.XMax
XMIN = frameExtent.XMin
YMAX = frameExtent.YMax
YMIN = frameExtent.YMin
pnt1 = arcpy.Point(XMIN, YMIN)
pnt2 = arcpy.Point(XMIN, YMAX)
pnt3 = arcpy.Point(XMAX, YMAX)
pnt4 = arcpy.Point(XMAX, YMIN)
array = arcpy.Array()
array.add(pnt1)
array.add(pnt2)
array.add(pnt3)
array.add(pnt4)
array.add(pnt1)
polygon = arcpy.Polygon(array)
arcpy.CopyFeatures_management(polygon, "Polygon_Extent")
... View more
11-21-2011
10:00 AM
|
5
|
0
|
6407
|
| Title | Kudos | Posted |
|---|---|---|
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM | |
| 1 | 01-20-2026 04:04 AM |
| Online Status |
Online
|
| Date Last Visited |
3 hours ago
|