Skip to main content

setExportFileOptions

汇总

MapSeriesExportOptions 对象表示可选属性的集合,这些属性可与 MapSeriesBookmarkMapSeries 对象上的 export 方法配合使用来配置地图系列的导出方式。

讨论

仅当您要使用不同于默认值的属性导出 MapSeriesBookmarkMapSeries 时,才需要此对象。

如果 class_type 参数设置为 MAPSERIES ,则可以使用 CreateExportOptions 函数创建 MapSeriesExportOptions 对象。 返回的对象包含配置如何导出地图系列所需的所有属性。

注:

当前地图系列对象仅可以导出为 JPEGFormatPNGFormatPDFFormatTIFFFormat

语法

setExportFileOptions()

属性

名称 说明 数据类型

customPages

(读取和写入)

一个字符串,用于在 exportPages 属性设置为 CUSTOM 时标识要导出的地图系列页面。 例如,以下字符串可导出 5 个页面: 1, 3, 5-7 。 默认值是空字符串。

String

exportFileOptions

(只读)

一个字符串常量,表示页面的导出方式。 要更改此值,请使用 setFileExportOptions 方法。 默认值为 PDF_SINGLE_FILE

  • PDF_MULTIPLE_FILES_PAGE_NAME—将每个地图系列页面导出到单个文件,并将页面名称追加到文件名称。 例如,Output.PDF 将变为 Output_LakeErie.PDF。

  • PDF_MULTIPLE_FILES_PAGE_NUMBER—将每个地图系列页面导出到单个文件,并将页码追加到文件名称。 例如,Output.PDF 将变为 Output_1.PDF。

  • PDF_SINGLE_FILE—将所有页面导出为包含多页的单个文件文档。

String

exportPages

(只读)

一个字符串常量,用于表示要导出的地图系列页面集合。 要更改此值,请使用 setExportPages 方法。 默认值为 ALL

  • ALL—导出地图系列中的所有页面。

  • CURRENT—导出当前的活动页面。 此选项仅在运行应用程序内的脚本时应用。

  • CUSTOM—导出使用 customPages 属性定义的一组自定义页面。

  • SELECTED_INDEX_FEATURES—仅导出与地图系列关联的已选索引要素对应的地图系列页面。

String

showExportCount

(读取和写入)

如果设置为 True ,您将看到每个正在导出页面的状态显示在 Python shell 中。 默认值为 False

Boolean

方法

setExportFileOptions(export_file_options)

一个字符串常量,表示页面的导出方式。

名称 说明 数据类型

export_file_options

  • MULTIPLE_FILES_PAGE_NAME—Export each map series page to an individual file and append the page name to the file name. For example, Output.PDF will become Output_LakeErie.PDF.

  • MULTIPLE_FILES_PAGE_NUMBER—Export each map series page to an individual file and append the page number to the file name. For example, Output.PDF will become Output_1.PDF.

  • PDF_SINGLE_FILE—Export all pages into a multipage, single file document.

(默认值为 PDF_SINGLE_FILE)

String

setExportPages(export_pages)

一个字符串常量,用于表示要导出的地图系列页面集合。

名称 说明 数据类型

export_pages

  • ALL— Export all pages in the map series.

  • CURRENT— Export the currently active page. This option only applies when running a script inside the application.

  • CUSTOM—Export a custom set of pages that is defined using the customPages property.

  • SELECTED_INDEX_FEATURES—Only export map series pages that correspond to the selected index features associated with the map series.

String

代码示例

MapSeriesExportOptions 示例

以下脚本使用默认 PDFFormat 属性导出 MapSeries 对象,但会将 MapSeriesExportOptions 配置为导出一组自定义地图系列页面。

p = arcpy.mp.ArcGISProject('current')
l = p.listLayouts('Layout_MS')[0]
ms = l.mapSeries

pdf = arcpy.mp.CreateExportFormat('PDF', r'c:\temp\MS_PDF.pdf')

msExOpt = arcpy.mp.CreateExportOptions('MAPSERIES')
msExOpt.setExportPages('CUSTOM')
msExOpt.customPages = '1-3'

ms.export(pdf, msExOpt)