|
POST
|
There are several ways this can be accomplished. It may depend on the type of renderer you are using. I would probably try authoring the MXD with a pre-authored layer (i.e., symbolized the way you want), generate the result, and then use arcpy.mapping to change the layer's data source. Check out: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Updating_and_fixing_data_sources_with_arcpy_mapping/00s30000004p000000/ Jeff
... View more
06-06-2012
06:22 AM
|
0
|
0
|
628
|
|
POST
|
Are you trying do this in the ArcMap UI or automate it with arcpy.mapping? Desktop UI: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/About_visualizing_temporal_data/005z0000000n000000/ Arcpy.mapping: DataFrame Class: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrameTime/00s300000023000000/ Layer Class: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Layer/00s300000008000000/ Jeff
... View more
06-05-2012
06:18 AM
|
0
|
0
|
1002
|
|
POST
|
Please provide examples of what you have and what you are trying to go to. Thanks, Jeff
... View more
06-04-2012
08:48 AM
|
0
|
0
|
2029
|
|
POST
|
If you can't share the data, you can always make up some data. I just need to see your workflow. Jeff
... View more
06-04-2012
08:47 AM
|
0
|
0
|
1500
|
|
POST
|
Have you tried automating this with arcpy.mapping? You could use a python script to change the text of a title element on you page layout. For example, mxd = arcpy.mapping.MapDocument("CURRENT")
title = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "title")[0]
lyr1 = arcpy.mapping.ListLayers(mxd, "Layer1")[0]
lyr1.visible = True
title.text = "Title for lyr 1"
lyr1.visible = False
lyr2 = arcpy.mapping.ListLayers(mxd, "Layer2")[0]
lyr2.visible = True
title.text = "Title for lyr 2"
etc. Jeff
... View more
06-04-2012
07:46 AM
|
1
|
0
|
639
|
|
POST
|
I'm trying to get my head around this. Is there any way you can provide a map package or zip with a very small, simple sample? Jeff
... View more
06-01-2012
06:18 AM
|
0
|
0
|
1500
|
|
POST
|
If I understand this correctly, you are building a map series where each page has 2 extents that represent different segments along a strip map. For example, one extent is all the odd numbered strip map extents and the other extent represents the even extents. I had done this for a customer a while back. My strategy was to use two MXDs. Below is the code I wrote. I'm using the DDP extent for each page from the DDP1.mxd to drive the extents in the NoDDP.mxd. import arcpy, os path = os.getcwd() mxd1 = arcpy.mapping.MapDocument(path + r"\DDP1.mxd") #DDP enabled MXD mxd1df1 = arcpy.mapping.ListDataFrames(mxd1, "Top")[0] #Reference the DF that DDP is based on mxd2 = arcpy.mapping.MapDocument(path + r"\NoDDP.mxd") #DDP is not enabled mxd2df1 = arcpy.mapping.ListDataFrames(mxd2, "Top")[0] #Top panel mxd2df2 = arcpy.mapping.ListDataFrames(mxd2, "Bottom")[0] #Bottom panel mxd2panelAtxt = arcpy.mapping.ListLayoutElements(mxd2, "TEXT_ELEMENT", "PanelA")[0] mxd2panelBtxt = arcpy.mapping.ListLayoutElements(mxd2, "TEXT_ELEMENT", "PanelB")[0] mxd2pages = arcpy.mapping.ListLayoutElements(mxd2, "TEXT_ELEMENT", "pages")[0] if os.path.exists(path + "\MapBook.pdf"): os.remove(path + "\MapBook.pdf") pdfDoc = arcpy.mapping.PDFDocumentCreate(path + "\MapBook.pdf") totalPageCount = mxd1.dataDrivenPages.pageCount #get the total pages from DDP1.mxd (and use those extents on the NoDDP.mxd page = 1 while page <= totalPageCount: mxd1.dataDrivenPages.currentPageID = page #this will be all odd pages (get the extent info) panelAExt = mxd1df1.extent panelARot = mxd1df1.rotation panelAtxt = mxd1.dataDrivenPages.pageRow.Name page = page + 1 #iterate the page number mxd1.dataDrivenPages.currentPageID = page #this will be all even pages panelBExt = mxd1df1.extent panelBRot = mxd1df1.rotation panelBtxt = mxd1.dataDrivenPages.pageRow.Name page = page + 1 if page > totalPageCount + 2: break mxd2df1.extent = panelAExt #Now update the NoDDP mxd based on extents preserved from DDP1.mxd mxd2df1.scale = 2400 mxd2df1.rotation = panelARot mxd2panelAtxt.text = panelAtxt mxd2df2.extent = panelBExt #Do it again for the second panel mxd2df2.scale = 2400 mxd2df2.rotation = panelBRot mxd2panelBtxt.text = panelBtxt mxd2pages.text = "Page " + str(page/2) + " of " + str(totalPageCount/2) arcpy.mapping.ExportToPDF(mxd2, path + r"\Sheet" + str(page-2) + ".pdf") pdfDoc.appendPages(path + r"\Sheet" + str(page-2) + ".pdf") os.remove(path + r"\Sheet" + str(page-2) + ".pdf") pdfDoc.saveAndClose() del mxd1, mxd2, pdfDoc
... View more
05-30-2012
07:39 AM
|
0
|
0
|
3805
|
|
POST
|
The Export Map dialog has the following option on the "Pages" tab: Export Pages As: Single PDF File Multiple PDF Files (page names) - I believe this is what you want Multiple PDF Files (page index) The same options are available via the arcpy.mapping ExportToPDF function. Jeff
... View more
05-30-2012
07:19 AM
|
0
|
1
|
1302
|
|
POST
|
I'm not sure this logic will work. For example, let us say I have a layer with the following data source: C:\\temp\\lines Your code [origSource2 = origSource.replace("\\","/")] is converting the string to: C:/temp/lines Then you are trying to perform a find and replace with a "find" string that does NOT exist in any of your sources because you changed it but perhaps that is why you are using validate=False. I don't know enough to assess the error. Can you send me just your MXD (no data) to [email protected]. From that I should be able to determine the data sources. Jeff
... View more
05-16-2012
07:00 AM
|
0
|
0
|
1661
|
|
POST
|
This unfortunately was not addressed for SP4. 10.1 will be the next release that addresses the issue. Jeff
... View more
05-16-2012
06:15 AM
|
0
|
0
|
1271
|
|
POST
|
Thank-you for reporting this. We already had corrected it for 10.1 but will get it into the 10.0 web help. Jeff
... View more
05-15-2012
08:49 AM
|
0
|
0
|
746
|
|
POST
|
I was able to reproduce using Bing Maps Aerial basemap. The higher level "Basemap" group layer does NOT support "DATASOURCE" but the sub-layer "BingMapsAerial" unfortunately does (the value is an empty string). We'll need to correct this. In the meantime can you try:
for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.supports("DATASOURCE") and lyr.supports("DATASETNAME"):
The BingMapsAerial sub-layer does NOT support "DATASETNAME".
... View more
05-15-2012
08:24 AM
|
0
|
0
|
1661
|
|
POST
|
Right click on the text element and select properties. Go to the Size and Position tab. Set the Element Name there. Be sure all elements that you want to find have a unique name. Jeff
... View more
05-15-2012
07:32 AM
|
0
|
0
|
3419
|
|
POST
|
This script works fine when run from IDLE (or from the Python window):
import arcpy
layer1 = arcpy.mapping.Layer(r"C:\Temp\NE_States.lyr")
layer1.findAndReplaceWorkspacePath(r"C:\Temp", r"\\JBarrette\Temp")
layer1.saveACopy(r"C:\Temp\NE_States2.lyr")
print layer1.dataSource
>>\\Jbarrette\Temp\NE_Lakes.shp
Are you attempting to change the dataset name in any way? FindAndReplaceWorkspacePath only works on the workspace path. Jeff
... View more
05-14-2012
08:31 AM
|
0
|
0
|
1319
|
|
POST
|
I don't see how layer variables know the path to the layer files. Try setting your workspace. Jeff
... View more
05-14-2012
07:21 AM
|
0
|
0
|
481
|
| 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
|