ArcGIS Pro 图层数据批量执行多部件转单部件
ArcGIS Pro文档的内容窗体中有很多图层,要求对它们进行多部件转单部件的批处理,如下图:
# 获取ArcGIS Pro当前文档的所有图层
import os
p = arcpy.mp.ArcGISProject("CURRENT")
m = p.listMaps()[0]
for lyr in m.listLayers():
arcpy.MultipartToSinglepart_management(in_features=lyr.dataSource,
out_feature_class=os.path.join(arcpy.env.workspace,lyr.name))
# 获取ArcMap当前文档的所有图层
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
for lyr in arcpy.mapping.ListLayers(mxd, df):
# 执行处理....