|
POST
|
The error message says it all "lyr" not defined. You have lyr.replaceDataSource when it should be brknItem.replaceDataSource Jeff
... View more
06-24-2011
06:17 AM
|
0
|
0
|
1183
|
|
POST
|
Have you tried isolating the issue? For example, does it happen when data driven pages are disabled? Are you editing in layout view or data view, etc. Please submit this to Support Services so they can help with isolating the issue. Thanks, Jeff
... View more
06-24-2011
06:14 AM
|
0
|
0
|
2407
|
|
POST
|
That is most likely because you have a layer type (e.g., group layer) that doesn't support "replaceDataSource". You should look at the help topic for layers, specifically the "supports" parameters. It explains all of this. I modified the code below (and removed an unnecessary if statement). import arcpy, os
path = r"N:\Temporary_Work\Oliver Morris\EDCOLLINS_ISOPACH"
for fileName in os.listdir(path):
fullPath = os.path.join(path, fileName)
if os.path.isfile(fullPath):
basename, extension = os.path.splitext(fullPath)
if extension == ".mxd":
mxd = arcpy.mapping.MapDocument(fullPath)
print "MXD: " + fileName
brknList = arcpy.mapping.ListBrokenDataSources(mxd)
for brknItem in brknList:
if brknItem.supports("DATASOURCE"):
lyr.replaceDataSource(r" N:\Temporary_Work\Oliver Morris\EDCOLLINS_ISOPACH\Isopach_mapping_2011.mdb","ACCESS_WORKSPACE","SEA_ODM_ISOPACH_110617")
print "\t" + brknItem.name
del mxd
... View more
06-22-2011
06:16 AM
|
0
|
0
|
1183
|
|
POST
|
SEA_110617 is the name of a feature class, not a variable. It therefore should be in quotes. Change it to "SEA_110617". Your code below is changing all broken layers to be the same source. Is that what you really want. Also note - if SEA_110617 is a raster dataset you may not be able to repair it. We just found an issue with rasters. We will address it at SP3. import arcpy, os
path = r"N:\Temporary_Work\Oliver Morris\EDCOLLINS_ISOPACH"
for fileName in os.listdir(path):
fullPath = os.path.join(path, fileName)
if os.path.isfile(fullPath):
basename, extension = os.path.splitext(fullPath)
if extension == ".mxd":
mxd = arcpy.mapping.MapDocument(fullPath)
print "MXD: " + fileName
brknList = arcpy.mapping.ListBrokenDataSources(mxd)
for brknItem in brknList:
lyr.replaceDataSource (r" N:\Temporary_Work\mapping_2011.mdb", "ACCESS_WORKSPACE", SEA_110617)
print "\t" + brknItem.name
del mxd
... View more
06-21-2011
06:22 AM
|
0
|
0
|
1183
|
|
POST
|
Not easily. It can be done with arcpy.mapping but it would require that you author a table outline in ArcMap using line graphics. Then you would populate dynamic text to fill the columns in the table. I'm working on getting a sample out on the resource center. Once I get data permissions, I'll put it up as soon as I can. Attached is a static table graphic (of grouped line elements). There are actually 3 tables, each with 3 columns. I have a total of 3 text elements, one for each column in each table. I read the rows from a GDB table and dynamically populate the text element with line breaks (to create the rows). I can fit up to 15 rows of data onto each table. If there are more than 15 rows, I populate the next table, etc. Here is the code that populates the table: for row in allRows:
if count < 15:
tab1Col1Txt.text = tab1Col1Txt.text + row.getValue("DATE") +"\n"
tab1Col2Txt.text = tab1Col2Txt.text + row.getValue("CHANGE") + "\n"
tab1Col3Txt.text = tab1Col3Txt.text + row.getValue("MADE_BY") + "\n"
if count >= 15 and count < 30:
tab2Col1Txt.text = tab2Col1Txt.text + row.getValue("DATE") + "\n"
tab2Col2Txt.text = tab2Col2Txt.text + row.getValue("CHANGE") + "\n"
tab2Col3Txt.text = tab2Col3Txt.text + row.getValue("MADE_BY") + "\n"
if count >= 30 and count < 45:
tab3Col1Txt.text = tab3Col1Txt.text + row.getValue("DATE") + "\n"
tab3Col2Txt.text = tab3Col2Txt.text + row.getValue("CHANGE") + "\n"
tab3Col3Txt.text = tab3Col3Txt.text + row.getValue("MADE_BY") + "\n" Jeff
... View more
06-01-2011
07:21 AM
|
0
|
0
|
5208
|
|
POST
|
At 10.0 you need to know the name of your index layer in the map document. (e.g., lyr = arcpy.mapping.ListLayers(mxd, "Index Layer")[0] At 10.1 we'll be introducing a new DDP Class property called indexLayer. (e.g., lyr = ddp.indexLayer) I hope this helps, Jeff
... View more
05-31-2011
02:58 PM
|
0
|
0
|
1042
|
|
POST
|
Jazmateta, Could you please send me your city limits feature class so I can try to reproduce the issue? Send a zip to jbarrette@esri.com. Thanks, Jeff
... View more
05-26-2011
06:31 AM
|
0
|
0
|
3877
|
|
POST
|
I really appreciate postings like these. It is what the forums are all about. The sample that this posting references was really about integrating arcpy.mapping with DDP and ReportLab. The main sample will run using an ArcView license. http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=FBE3D235-1422-2418-8820-E071ED243854 The issue is the outlined ArcInfo level analysis I used to format the source table. I would be happy to update the sample with additional steps/scripts. Please send me what you have and I'll integrate it into the sample notes - jbarrette@esri.com Thanks, Jeff
... View more
05-23-2011
07:28 AM
|
0
|
0
|
2700
|
|
POST
|
Eric, Do you get the same performance exporting to PDF via ArcMap (File--> Export Map...)? Jeff
... View more
05-19-2011
06:51 AM
|
0
|
0
|
1132
|
|
POST
|
In order to help with this I will need more information. From what I gather, you have a template MXD with all the right page elements. I'm not clear on the how you "open" a layer and click on a button part. I'm also trying to figure out a way to do this without VBA. Rather than opening a new MXD, are you OK with the current template MXD being dynamically updated with the choosen layer? I'm trying to move you towards arcpy.mapping to perform your automation. The button could be a script tool that does what you need. Jeff
... View more
05-18-2011
08:50 PM
|
0
|
0
|
599
|
|
POST
|
Phew! I was a bit nervous for a moment there. Thanks for the update!!! Jeff
... View more
05-13-2011
06:57 AM
|
0
|
0
|
1312
|
|
POST
|
You may want to try posting this to the Editing forum. http://forums.arcgis.com/forums/116-Editing Jeff
... View more
05-13-2011
06:50 AM
|
0
|
0
|
2124
|
|
POST
|
Not all in one example but here are two samples that should get you going: The 4th sample in the DataFrame class help. The AddLayer or RemoveLayer help samples If all your layers are already in the MXD, then use the first sample to see if they intersect with the data frame. If they don't, then remove the layer using those samples. Jeff
... View more
05-11-2011
02:52 PM
|
0
|
0
|
1176
|
|
POST
|
This issue has been fixed and will be available with SP3. Thanks, Jeff
... View more
05-10-2011
09:58 AM
|
0
|
0
|
1326
|
|
POST
|
Yes. The fix was just verified. It is marked to go into SP3. Jeff
... View more
05-10-2011
09:56 AM
|
0
|
0
|
1457
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-05-2025 11:20 AM | |
| 3 | 06-05-2025 09:21 AM | |
| 1 | 05-14-2025 01:19 PM | |
| 2 | 04-24-2025 07:54 AM | |
| 1 | 03-15-2025 07:19 PM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|