|
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
|
405
|
|
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
|
911
|
|
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
|
1616
|
|
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
|
856
|
|
POST
|
This issue has been fixed and will be available with SP3. Thanks, Jeff
... View more
05-10-2011
09:58 AM
|
0
|
0
|
1011
|
|
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
|
1069
|
|
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
|
1069
|
|
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
|
679
|
|
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
|
789
|
|
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
|
679
|
|
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
|
856
|
|
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
|
434
|
|
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
|
911
|
|
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
|
2824
|
|
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
|
401
|
| 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
|