|
POST
|
Your code is doing 2 different forms of zoom. df.zoomToSelectedFeatures zooms to selected features in ALL layers. df.extent = lyr.getSelectedExtent() zooms to features ONLY in that layer. It would make sense that you get different results if you sometimes have other selected features. Jeff
... View more
07-16-2011
11:41 AM
|
0
|
0
|
500
|
|
POST
|
Arcpy.mapping would be a much easier solution. Take a look at the DataDrivenPages and PictureElements class help topic for some sample code snippets. Basically you will use the DDP object to advance your pages and at each page you will reference each PictureElement and change the sourceImage property. Jeff
... View more
07-16-2011
10:40 AM
|
0
|
0
|
428
|
|
POST
|
I don't believe this can be done with dynamic text but can easily be done with Python. now - timedelta(days=3)
... View more
07-08-2011
06:11 AM
|
0
|
0
|
407
|
|
POST
|
There is not a way to change page size at 10.0 (or 10.1). This is an MXD authoring step. If you are trying to simulate a map book or some page series that have different pages sizes or page orientations you must build those templates and have your arcpy.mapping application reference the appropriate mxd. The following help topic shows and example with facing pages. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Creating_a_map_book_with_facing_pages/00s90000002p000000/ Jeff
... View more
07-06-2011
01:49 PM
|
0
|
0
|
449
|
|
POST
|
I think the problem here is that you are mixing symbology renderers and this can't even be done in the UI. For example, in the UI, add an RGB Composite raster. Then try to set its datasource to just one of the bands (via the Source tab). It won't let you. If you set the symbology properties to be Stretched first (must click OK), then you can change the source to a specific band. You need to author two different layer files. One for Composite and one for Stretched. Don't try to update a composite with a stretched layer file. I hope this helps, Jeff
... View more
06-24-2011
08:47 AM
|
0
|
0
|
421
|
|
POST
|
I'm not sure what "tool" you are referring to but have you looked at the arcpy.Polygon function? http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v000000n1000000.htm Jeff
... View more
06-24-2011
07:07 AM
|
0
|
0
|
588
|
|
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
|
867
|
|
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
|
1911
|
|
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
|
867
|
|
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
|
867
|
|
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
|
4082
|
|
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
|
676
|
|
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
|
2835
|
|
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
|
1613
|
|
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
|
860
|
| 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 |
2 weeks ago
|