jwickers

Inserting Multiple Mxd outputs into one pdf

Discussion created by jwickers on Nov 14, 2010
Latest reply on Nov 15, 2010 by jwickers
I'm developing a tool where the user can choose multiple mxds andthe script zooms to the same selected record and exports to pdf.

A pdf is created from the first mxd input, but how can I insert more outputs into this one pdf as teh script loops through multiple mxds?

Thanks

Jane

# Import arcpy module
import arcpy
from arcpy import env


arcpy.overwriteoutput = 1

#Load required toolboxes...
##gp.AddToolbox("C:/Program Files/ArcGIS/Desktop10.0/ArcToolbox/Toolboxes/Data Interoperability Tools.tbx")

###Input Parameters
LotSecPlan = arcpy.GetParameterAsText(0)

template1 = arcpy.GetParameterAsText(1)

template2 = arcpy.GetParameterAsText(2)

template3 = arcpy.GetParameterAsText(3)

input_scale = arcpy.GetParameterAsText(4)

description = arcpy.GetParameterAsText(5)


### Create jane.pdf for Template1
mxd = arcpy.mapping.MapDocument(template1)
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
lyr = arcpy.mapping.ListLayers(mxd, r"TWEED9_SP_PARCEL_polygon", df)[0]
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", "\"PROCLAIM_LINK\" = '"+LotSecPlan+"'")
df.zoomToSelectedFeatures()
##df.scale = df.scale * 1.10000
df.scale = input_scale
mxd.description = description
arcpy.mapping.ExportToPDF(mxd, r"Z:\GIS_Staff\jane\Scripting\jane.pdf")
arcpy.RefreshActiveView()
del mxd

###Insert Template 2 into jane.pdf
mxd = arcpy.mapping.MapDocument(template2)
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
lyr = arcpy.mapping.ListLayers(mxd, r"TWEED9_SP_PARCEL_polygon", df)[0]
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", "\"PROCLAIM_LINK\" = '"+LotSecPlan+"'")
df.zoomToSelectedFeatures()
##df.scale = df.scale * 1.10000
df.scale = input_scale
mxd.description = description
??arcpy.mapping.ExportToPDF(mxd, r"Z:\GIS_Staff\jane\Scripting\jane.pdf")
arcpy.RefreshActiveView()
del mxd

###Insert Template 3 into jane.pdf
mxd = arcpy.mapping.MapDocument(template3)
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
lyr = arcpy.mapping.ListLayers(mxd, r"TWEED9_SP_PARCEL_polygon", df)[0]
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", "\"PROCLAIM_LINK\" = '"+LotSecPlan+"'")
df.zoomToSelectedFeatures()
##df.scale = df.scale * 1.10000
df.scale = input_scale
mxd.description = description
??arcpy.mapping.ExportToPDF(mxd, r"Z:\GIS_Staff\jane\Scripting\jane.pdf")
arcpy.RefreshActiveView()
del mxd
print "Finished"

Outcomes