arcpy实现注记合并
import os
import arcpy
import sys
reload(sys)
sys.setdefaultencoding('utf8')
try:
arcpy.env.workspace = r"C:\Users\Admin\Desktop\HBZJ.mdb"
datasets = arcpy.ListDatasets(feature_type='feature')
for ds in datasets:
print(ds)
fcs = arcpy.ListFeatureClasses("ZJ*", "ANNOTATION",feature_dataset=ds)
for fc in fcs:
path = os.path.join(arcpy.env.workspace, ds, fc)
print(path)
outFeatureClass = r"C:/Users/Admin/Desktop/HBZJ.mdb/DS/ZJ"
refScale = 1000
createClasses = "CREATE_CLASSES"
symbolReq = "NO_SYMBOL_REQUIRED"
autoCreate = "AUTO_CREATE"
autoUpdate = "AUTO_UPDATE"
arcpy.AppendAnnotation_management(fc, outFeatureClass, refScale, createClasses, symbolReq, autoCreate, autoUpdate)
arcpy.Delete_management(fc)
print("OVER")
except arcpy.ExecuteError:
print arcpy.GetMessages()