|
POST
|
This is a known issue: NIM085743 - UpdateLayer will not update symbology if the source layer object is not in the map. We will address it in a future service pack. Thanks, Jeff
... View more
10-18-2012
09:01 AM
|
0
|
0
|
2666
|
|
POST
|
One of the common issues people have with AGO content is that they need to change their "show" setting from "Web Content" to "All. Try this, this will get you to the arcpy.mapping group where you can see many samples posted: Go to: http://www.arcgis.com/home/ Then click the Groups link In the search box, type "arcpy.mapping Click on the one resulting link. Make sure you change "Show" to all - it alone the top of the screen. You should see all the (9) samples The one you want is called "DDPwithDynamicTablesAndGraphs_10.1_v1" I really hope this works for you, Jeff
... View more
10-17-2012
09:29 AM
|
0
|
0
|
1970
|
|
POST
|
Ken, Data Driven Pages do not support dynamic tables. This was something we hoped to accomplish in the UI for 10.1 (if time allowed). But at 10.1 we were able to expand the arcpy.mapping API that allows us to build truly dynamic tables (graphically) using the new cloning capabilities. The idea is to use scripting logic to dynamically build the graphic table by cloning horizontal and vertical lines that ultimately construct a table. This logic is executed for each page in a series and therefore, each page can have a table that has a different number of rows, etc. The text in the table is basic inserted text elements (not dynamic text in the sense of DDP but dynamic in the sense that you can alter it dynamically through code). I typically have one text element for each column in a table. Then using scripting logic, I populate that column of data by reading rows in a data source and concatenate each value with a new line in between each value. The best and newest sample available can be found at: http://www.arcgis.com/home/item.html?id=3a525b986b774a3f9cbbd8daf2435852 This method does not care what the data source is (e.g., DBF, excel). If you can read the table in ArcMap, then you can write the information to the graphic table. Download it and take a look at the code. I really hope this helps, Jeff
... View more
10-16-2012
07:53 AM
|
0
|
0
|
1970
|
|
POST
|
Don't use single quote, use double quotes instead. Function FindLabel ([Wellname]) if ([Wellname] = "29Nowugs04") then FindLabel = UCase([Wellname]) else FindLabel = [Wellname] end if End Function I get the same error if I use single quotes. Jeff
... View more
10-15-2012
06:50 AM
|
0
|
0
|
3062
|
|
POST
|
No. Dynamic Text provides many different formatting options for dates, times, coord systems, etc but it does not provide the logic to perform mathematical operations. You would need to incorporate Python and then use arcpy.mapping to update text elements in a layout. Jeff
... View more
10-12-2012
06:09 AM
|
0
|
1
|
1076
|
|
POST
|
Check the value of your NewS shapefile variable. The string includes the full path to the shapefile (e.g., "C:\Data\parks.shp"), the parameter should only include the feature class name (e.g., "parks"). I tested a couple of other parameter types and they all returned the full path. You may need to parse it yourself. Jeff
... View more
10-11-2012
05:54 AM
|
0
|
0
|
1280
|
|
POST
|
This is a known limit (NIM063441) when exporting "Added Tables" in a layout to PDF from a stand-alone script or script tool. If you run the same python script from the Python window, using current or a file path to the mxd, it will work. There is also a known limit trying to export OLE tables. Here are some Python solutions to working with dynamic tables in a layout using arcpy.mapping. Static Graphic Tables: http://www.arcgis.com/home/item.html?id=af4fe32a93554eadbd3be3b0e55326be Dynamic Graphic Tables: http://www.arcgis.com/home/item.html?id=3a525b986b774a3f9cbbd8daf2435852 Jeff
... View more
10-09-2012
03:15 PM
|
0
|
0
|
1860
|
|
POST
|
I think the following script will do what you need. Make sure to save the MXD with ALL group layers checked off (and all layers within the group layer checked on). See attached screen shot. A field was added to the index layer called "GroupLayerName". It has the values "GroupLayer1, GroupLayer2, etc). After exporting to PDF, the script then turns the group layer back off again before going to the next DDP page.
import arcpy
mxd = arcpy.mapping.MapDocument(r"c:\Temp\test.mxd")
ddp = mxd.dataDrivenPages
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
fieldValue = mxd.dataDrivenPages.pageRow.GroupLayerName
for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.name == fieldValue:
lyr.visible = True
arcpy.mapping.ExportToPDF(mxd, r"C:\\Temp\\" + fieldValue + ".pdf")
lyr.visible = False
del mxd [ATTACH=CONFIG]18285[/ATTACH] Jeff
... View more
10-09-2012
06:25 AM
|
0
|
0
|
3884
|
|
POST
|
Could you provide screen shots and anything else that may be unique about your tables (e.g., source data, ole object, etc). Jeff
... View more
10-08-2012
06:20 AM
|
0
|
0
|
1860
|
|
POST
|
Are you saying that if you physically open an MXD in ArcMap, look at the layout, export to PDF, all is well. But if you connect to an mxd via arcpy.mapping and export to PDF, you don't get the same results?
import arcpy
mxd = arcpy.mapping.MapDocument(path to mxd)
arcpy.mapping.ExportToPDF(mxd, path to pdf)
del mxd
It would be nice to see your output PDFs. Jeff
... View more
10-04-2012
07:53 AM
|
0
|
0
|
1165
|
|
POST
|
Then try what Jake suggests. In your original code, you reference an MXD but never a layer within it. Rather you are referencing a layer file via the .Layer function. You need to use ListLayers to reference a layer in an MXD. Then you can switch out the data source. Jeff
... View more
10-02-2012
06:11 AM
|
1
|
0
|
5178
|
|
POST
|
Are you trying to change the workspace for a data source in a layer file or for a layer in an mxd? Both scenarios are supported but the two snippets of code are doing different things? If you are trying to work with layer files you are missing one step. Treat a layer file like an MXD. Once you connect to it, you still need to search for the layers within it using ListLayers.
#In example below, a layer file if pointing to a shapefile in c:\temp
#It is redirected to a data source in c:\active
#and then saved to a new layer file (in c:temp)
#Old shapefile was usa.shp, new one is use2.shp
import arcpy
lyrFile = arcpy.mapping.Layer(r"C:\Temp\usa.lyr")
for lyr in arcpy.mapping.ListLayers(lyrFile): #THIS IS THE MISSING PIECE
if lyr.name == "usa":
lyr.replaceDataSource(r"C:\Active", "SHAPEFILE_WORKSPACE", "usa2")
lyrFile.saveACopy(r"C:\Temp\usa2.lyr") Jeff
... View more
09-28-2012
06:45 AM
|
1
|
0
|
5178
|
|
POST
|
Please refer to the following posts: http://forums.arcgis.com/threads/66365-how-to-dynamically-update-a-data-driven-page-excel-table http://forums.arcgis.com/threads/67743-Adding-table-to-layout-view Thanks, Jeff
... View more
09-28-2012
06:26 AM
|
0
|
0
|
630
|
|
POST
|
Dynamic excel tables are not supported with DDP. You must use one of the techniques provided in an earlier response. Jeff
... View more
09-27-2012
12:30 PM
|
0
|
0
|
2041
|
|
POST
|
Check out the following samples on ArcGIS Online. This 10.0 sample demonstrates static graphic tables: http://www.arcgis.com/home/item.html?id=af4fe32a93554eadbd3be3b0e55326be This 10.1 sample demonstrates dynamic graphic tables using the new arcpy.mapping cloning capabilities: http://www.arcgis.com/home/item.html?id=3a525b986b774a3f9cbbd8daf2435852 Jeff
... View more
09-27-2012
06:55 AM
|
0
|
0
|
1279
|
| 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 |
06-23-2026
10:29 AM
|