|
POST
|
We addressed this issue. Arcpy.mapping was always using BEST for image quality therefore the image sizes were always larger. We've exposed a new {image_quality} parameter to the PrintMap function. Jeff
... View more
05-10-2011
08:40 AM
|
0
|
0
|
1451
|
|
POST
|
This is unfortunately a known limit for 10.0. The original envelop size (what is being centered on) needs to be maintained so that scale bars don't shrink when you go from page to page. At 10.1 we've introduced some new scale bar options and fixes that elimiate this issue. Jeff
... View more
05-09-2011
08:27 AM
|
0
|
0
|
997
|
|
POST
|
Have you considered using Data Driven pages? If you build your extent rectangles to be the same proportion as your data frame in the layout and set the scale to be 100%, your edges will match the way you describe. Check out the following links: What are Data Driven Pages Building Map Books with ArcGIS There are numerous other related links. Jeff
... View more
05-06-2011
01:14 PM
|
0
|
0
|
1036
|
|
POST
|
Have you tried authoring the MXD with the scalebar anchor position at Center, Center rather than lower left? Jeff
... View more
05-06-2011
12:46 PM
|
0
|
0
|
997
|
|
POST
|
This will be one of the new features available with the Legend in 10.1. Currently, the only way to do it is via ArcObjects development. It could be done with arcpy.mapping but each feature type would need to be its own layer. Then you could perform a spatial overlay, determine what is in the extent, and then remove or add the appropriate layers. You would need to make sure your legend has the setting to automatically update with layer changes. Jeff
... View more
05-05-2011
06:17 AM
|
0
|
0
|
1175
|
|
POST
|
Here is your corrected code that was on the previous post. It is much easier to read when tags are wrapped around it via these forum posts. See below.
Your code suggests to me that you are running it as a stand-alone script because you are importing arcpy and NOT using the keyword CURRENT. I take it that your exported PDFs do have the correct images. If you want to run your code in the Python window and see ArcMap update from page to page while your script is running then you would need to use arcpy.RefreshActiveView(). I also suggest that you insert a time delay.
Jeff
import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Temp\Photo.mxd")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
imageName = mxd.dataDrivenPages.pageRow.getValue("image4map")
for elm in arcpy.mapping.ListLayoutElements(mxd,"PICTURE_ELEMENT"):
if elm.name == "photo1":
elm.sourceImage = "C:\\Temp\\" + imageName
arcpy.mapping.ExportToPDF(mxd, r"C:\Temp\\" + str(pageNum) + ".pdf")
del mxd
... View more
05-04-2011
06:42 AM
|
0
|
0
|
577
|
|
POST
|
Let me clarify the confusion. Unfortunately, NIM061274 was marked as a duplicate and NIM064633 is the bug being tracked internally by Esri. This was resolved and addressed for 10.0 SP2 and does appear in the Fixed Issues list. The other two bugs listed in the previous post (NIM064668 and NIM058666) are related issues and were both resolved for 10.0 SP2. I need to do some more testing but it appears the previous post is suggesting that the new fix is breaking data paths for layers stored in an MXD when relative paths are turned on. I can't reproduce. I assume you are talking about saving an MXD. I ran mxd.saveACopy on an MXD with relative paths, saved out a 9.3 mxd, renamed the parent folder and could still open the 9.3 mxd without broken paths. Thank you! Jeff
... View more
05-03-2011
01:02 PM
|
0
|
0
|
1311
|
|
POST
|
Andra, I've looked at your code and made a few corrections to it. The currentPageID line needs to be in the loop and I think your output filename may have caused problems. Here is code very simily to your code. import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Temp\Photo.mxd")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
imageName = mxd.dataDrivenPages.pageRow.getValue("image4map")
for elm in arcpy.mapping.ListLayoutElements(mxd,"PICTURE_ELEMENT"):
if elm.name == "photo1":
elm.sourceImage = "C:\\Temp\\" + imageName
print "Exporting Page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount))
arcpy.mapping.ExportToPDF(mxd, r"C:\Temp\\" + str(pageNum) + ".pdf")
del mxd Because when switching out photos, the size and positing may change so I further modified the code to elimiate extra looping and included the orginal size/positioning info that is reapplied to each new picture. import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Temp\Photo.mxd")
elm = arcpy.mapping.ListLayoutElements(mxd, "PICTURE_ELEMENT", "photo1")[0]
elmX = elm.elementPositionX; elmY = elm.elementPositionY
elmHeight = elm.elementHeight; elmWidth = elm.elementWidth
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
imageName = mxd.dataDrivenPages.pageRow.getValue("image4map")
elm.sourceImage = "C:\\Temp\\" + imageName
elm.elementPositionX = elmX; elm.elementPositionY = elmY
elm.elementHeight = elmHeight; elm.elementWidth = elmWidth
print "Exporting Page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount))
arcpy.mapping.ExportToPDF(mxd, r"C:\Temp\\" + str(pageNum) + ".pdf")
del mxd I hope this helps, Jeff
... View more
05-03-2011
10:13 AM
|
0
|
0
|
3322
|
|
POST
|
There is not an ArcTutor tutorial but there are numerous help topics and blog postings concerning Data Driven Pages. I suggest you do a search on the Resource Center to find these topics. There was a recent sample made available that addresses ExportToPDF as a web service: http://www.arcgis.com/home/item.html?id=442e1c7ff64240af8f41825f567e60d0 Jeff
... View more
05-03-2011
07:07 AM
|
0
|
0
|
516
|
|
POST
|
Ryan, I could not reproduce. There are a couple of things. 1) The aspect ratio of your data frames need to be similar otherwise the extents can not be the same - we don't warp the data but fit the extent until the one of the delta Xs or Ys are fitted. 2) did you save your changes? Here is my code - I have a simple MXD with 2 data frames, the main is 6x6 inches and the inset is 2x2 inches. import arcpy MXD = arcpy.mapping.MapDocument(r"C:\Temp\df.mxd") DF = arcpy.mapping.ListDataFrames(MXD, "main")[0] newInsetExtent = DF.extent DF_inset = arcpy.mapping.ListDataFrames(MXD, "inset")[0] DF_inset.extent = newInsetExtent MXD.saveACopy(r"C:\Temp\df2.mxd")
... View more
04-29-2011
10:56 AM
|
0
|
0
|
927
|
|
POST
|
I'm trying to reproduce the issue. I've tried everything you suggest (SDE data, no SDE data, DDP, no DDP, etc). I'm even trying to use the same symbols. Could you send me a couple of your layer files? Send directly to jbarrette@esri.com. Thanks, Jeff
... View more
04-21-2011
11:56 AM
|
0
|
0
|
1272
|
|
POST
|
We reproduced this issue an will hopefully be able to address it in the next service pack. If you want to check its status, it is: NIM067167
... View more
04-20-2011
11:53 AM
|
0
|
0
|
1231
|
|
POST
|
We reproduced this issue an will hopefully be able to address it in the next service pack. It appears to be related to the output file size. Anything over 1GB will not work or open correctly. If you want to check its status, it is: NIM067258
... View more
04-20-2011
11:51 AM
|
0
|
0
|
2436
|
|
POST
|
We can reproduce this issue an will hopefully be able to address it in the next service pack. If you want to check its status, it is: NIM067157 Thanks, Jeff
... View more
04-15-2011
01:02 PM
|
0
|
0
|
1322
|
|
POST
|
We reproduced this issue an will hopefully be able to address it in the next service pack. Our fix is to prevent web service and image service layers from supporting Layer.dataSource. You can then test to see if a layer supports the Layer.dataSource property before attempting to modify a data source. If you want to check its status, it is: NIM067149 Thanks! Jeff
... View more
04-15-2011
10:10 AM
|
0
|
0
|
2601
|
| 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
|