arcpy.management.EnableArchiving(in_dataset)
|
名称
|
说明
|
数据类型
|
|
in_dataset
|
将启用存档的数据集的名称。
|
Table; Feature Class; Feature Dataset
|
派生输出
|
名称
|
说明
|
数据类型
|
|
out_dataset
|
已更新的输入数据集。
|
Table; Feature Class; Feature Dataset
|
代码示例
EnableArchiving 示例 1(Python 窗口)
以下代码片段说明了如何在 Python 窗口中使用 EnableArchiving 函数。
import arcpy
arcpy.management.EnableArchiving("Database Connections//toolbox.county.parcels")
EnableArchiving 示例 2(独立脚本)
以下脚本演示了如何在独立脚本中使用 EnableArchiving 函数。
# Name: EnableArchiving_Example.py
# Description: Enable archiving on a dataset
# Import system modules
import arcpy
# Set local variables
in_dataset = 'C:/Data/connections/Redlands.sde/TEST.TOOLBOX.rdlsstreets'
# Describe the properties of the dataset to see if archiving is enabled.
desc = arcpy.Describe(in_dataset)
isArch = desc.isArchived
# Enable Archiving if it is not already enabled.
if isArch == False:
# Run EnableArchiving
arcpy.management.EnableArchiving(in_dataset)
print("{0} has been enabled for archiving.".format(in_dataset))
elif isArch == True:
# If IsArch = True, then archiving is already enabled
print("{0} already has archiving enabled.".format(in_dataset))