arcgis arcengine 标注转注记代码
//把标注转换注记
procedure ConvertLabelsToGDBAnnotationSingleLayer(pMap: Imap;
pFeatureLayer: IFeatureLayer; pannworkspace: IWorkspace;
AnnLayername: string; featureLinked: bool);
var
pConvertLabelsToAnnotation : IConvertLabelsToAnnotation;
pTrackCancel : ITrackCancel;
pGeoFeatureLayer : IGeoFeatureLayer;
pFeatureClass : IFeatureClass;
pFeatureWorkspace : IFeatureWorkspace;
begin
pConvertLabelsToAnnotation := CoConvertLabelsToAnnotation.create as
IConvertLabelsToAnnotation;
pTrackCancel := CoCancelTracker.create as ITrackCancel;
pConvertLabelsToAnnotation.Initialize(pMap, esriDatabaseAnnotation,
esriAllFeatures, true, pTrackCancel, nil);
pGeoFeatureLayer := pFeatureLayer as IGeoFeatureLayer;
if (pGeoFeatureLayer <> nil) then
begin
pGeoFeatureLayer.Get_FeatureClass(pFeatureClass);
pFeatureWorkspace := pannworkspace as IFeatureWorkspace;
pConvertLabelsToAnnotation.AddFeatureLayer(pGeoFeatureLayer,
AnnLayername, pFeatureWorkspace,
nil, featureLinked, False, False, true,
true, '');
pConvertLabelsToAnnotation.ConvertLabels();
end;
end