POST
|
Hello, I am having trouble with a script that I've used hundreds of times in 10.0 and 10.1 but no longer works in 10.3. It is necessary for me to export the data frame instead of the entire page layout so I am passing the data frame object to the ExportToPDF function and I am providing height and width with df_export_height and df_export_width. I have always set the height to df.elementHeight / 0.004 and width to df.elementWidth / 0.004 because this ensures that the pdf document's height and width are the same as the data frame's height and width. This part still works. A data frame set to 36 inches by 48 inches will result in a 36x48 inch pdf. But the exported map appears to be zoomed out to about 1:60,000 even though I've set the df.scale to 31680. I have tried different data frame heights and widths, different scales, and different mxds but the pdf always appears zoomed out to around double the data frame scale. This code produced pdfs with the appropriate scale before I upgraded to 10.3. mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd)[0]
df.scale = 31680
dfew = df.elementWidth/0.004
dfeh = df.elementHeight/0.004
arcpy.mapping.ExportToPDF(mxd, 'C:/test.pdf', df, df_export_width=dfew, \
df_export_height=dfeh, resolution=250, image_quality='BETTER', \
jpeg_compression_quality=25, layers_attributes='NONE') Thanks for any help.
... View more
02-05-2016
01:59 PM
|
0
|
0
|
1692
|
POST
|
Thank you Jeff. I appreciate the information. And sorry about using the wrong forum. I thought I was in Map Automation but obviously clicked the wrong link.
... View more
02-24-2013
12:12 PM
|
0
|
0
|
234
|
POST
|
Hi, I've been trying to automate the creation of county maps at a constant scale of 1:63360. To maintain scale, I have to change either the page size or the data frame size. I don't think there is a way to change page size using arcpy, or is there? But it's pretty easy to change data frame size using arcpy. But then, rather than export the page layout, I would like to export the data frame. This works great, and it's fun to watch the data frame jumping around to fit each county, but when I export using ExportToPDF(mxd, "file.pdf", df, df_export_width=1600, df_export_height=1200), it doesn't export the legend or any text elements in the data frame. Is there a way to export the data frame along with all the other map elements? Would grouping the other elements with the data frame work? If so, how do you group elements in arcpy? Thanks!
... View more
02-14-2013
02:48 PM
|
0
|
2
|
626
|
POST
|
Hello, I have a NAD 83 State Plane data frame with several NAD 83 State Plane layers and a few WGS 84 GCS layers. I've set the data frame to transform the WGS 84 layers to NAD 83 using the WGS84_to_NAD83_5 datum transformation (my data was collected in North Carolina). I have also added a measured grid that shows NAD 27 UTM coordinates. It looks pretty good when zoomed out but when I look close I can see that the grid is offset about 20 meters from where I'm fairly certain the grid lines should be. Is this because the grid is not being transformed to NAD 83? If so, is there a way to place a datum transformation on a measured grid? Or is there something else going on? Thanks!
... View more
02-14-2013
02:23 PM
|
0
|
1
|
656
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|