import arcpy MxdPath = arcpy.GetParameterAsText(0) OutPath = arcpy.GetParameterAsText(1) PrinterPath = arcpy.GetParameterAsText(2) mxd = arcpy.mapping.MapDocument(MxdPath) arcpy.SetProgressor("default","Exporting Data Driven Page to Plotfile...") arcpy.SetProgressor("step","",0,mxd.dataDrivenPages.pageCount,1) for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1): mxd.dataDrivenPages.currentPageID = pageNum pageName = mxd.dataDrivenPages.pageRow.SORTMAPNUM arcpy.SetProgressorLabel("Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount))) arcpy.SetProgressorPosition(mxd.dataDrivenPages.currentPageID) arcpy.AddMessage("Writing File: " + OutPath + "\\" + str(pageName) + ".prn") arcpy.mapping.PrintMap(mxd,PrinterPath,"PAGE_LAYOUT",OutPath + "\\" + str(pageName) + ".prn") del mxd
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.