This document is archived and information here might be outdated.  Recommended version.


IConvertLabelsToAnnotation.AddFeatureLayer Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Carto)  

IConvertLabelsToAnnotation.AddFeatureLayer Method

Call this method for each feature layer be converted to annotation.

[Visual Basic .NET]
Public Sub AddFeatureLayer ( _
    ByVal pFeatureLayer As IFeatureLayer, _
    ByVal annoLayerName As String, _
    [ByVal pFeatureWorkspace As IFeatureWorkspace], _
    [ByVal pFeatureDataset As IFeatureDataset], _
    [ByVal FeatureLinked As Boolean], _
    [ByVal appendMode As Boolean], _
    [ByVal RequireSymbolID As Boolean], _
    [ByVal AutoCreate As Boolean], _
    [ByVal autoUpdate As Boolean], _
    [ByVal configKeyword As String] _
)
[C#]
public void AddFeatureLayer (
    IFeatureLayer pFeatureLayer,
    string annoLayerName,
    IFeatureWorkspace pFeatureWorkspace,
    IFeatureDataset pFeatureDataset,
    bool FeatureLinked,
    bool appendMode,
    bool RequireSymbolID,
    bool AutoCreate,
    bool autoUpdate,
    string configKeyword
);
[C#]

Optional Values

pFeatureWorkspace   Supply 0 as a default value.
pFeatureDataset   Supply 0 as a default value.
FeatureLinked   Supply false as a default value.
appendMode   Supply false as a default value.
RequireSymbolID   Supply false as a default value.
AutoCreate   Supply false as a default value.
autoUpdate   Supply false as a default value.
configKeyword   Supply as a default value.
[C++]
HRESULT AddFeatureLayer(
  IFeatureLayer* pFeatureLayer,
  BSTR annoLayerName,
  IFeatureWorkspace* pFeatureWorkspace,
  IFeatureDataset* pFeatureDataset,
  VARIANT_BOOL FeatureLinked,
  VARIANT_BOOL appendMode,
  VARIANT_BOOL RequireSymbolID,
  VARIANT_BOOL AutoCreate,
  VARIANT_BOOL autoUpdate,
  BSTR configKeyword
);
[C++]

Parameters pFeatureLayer [in]
pFeatureLayer is a parameter of type IFeatureLayer annoLayerName [in] annoLayerName is a parameter of type BSTR pFeatureWorkspace [in, optional, defaultvalue(0)]
pFeatureWorkspace is a parameter of type IFeatureWorkspace pFeatureDataset [in, optional, defaultvalue(0)]
pFeatureDataset is a parameter of type IFeatureDataset FeatureLinked [in, optional, defaultvalue(VARIANT_FALSE)] FeatureLinked is a parameter of type VARIANT_BOOL appendMode [in, optional, defaultvalue(VARIANT_FALSE)] appendMode is a parameter of type VARIANT_BOOL RequireSymbolID [in, optional, defaultvalue(VARIANT_FALSE)] RequireSymbolID is a parameter of type VARIANT_BOOL AutoCreate [in, optional, defaultvalue(VARIANT_FALSE)] AutoCreate is a parameter of type VARIANT_BOOL autoUpdate [in, optional, defaultvalue(VARIANT_FALSE)] autoUpdate is a parameter of type VARIANT_BOOL configKeyword [in, optional, defaultvalue()] configKeyword is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

This method adds a layer to the list of layers for which labels will be converted into annotation. Initialize should be called on the ConvertLabelsToAnnotation object before calling this method. This method may be called multiple times for one conversion when more that one layer will be converted.

Depending on the storage type chosen in initialize, some of the input parameters are optional. For map annotation, input the following items:

 ~ A reference to the feature layer the labels will be converted from
 ~ The name of the annotation group that will added to the map
 ~ For geodatabase annotation, input the following items:
 ~ A reference to the feature layer the labels will be converted from
 ~ The name of the annotation feature class that will either be created or appended to (see the append mode section below for more information)
 ~ The workspace the annotation feature class will reside in
 ~ The feature dataset the annotation feature class will reside in
 ~ The option to create feature linked annotation or not (True or False)
 ~ The option to append to an existing class or not (True or False). See the note about append below for more information.
 ~ The option on whether or not the created annotation feature class should require that elements reference a symbol in the symbol collection. (This option is not used if append mode=True).
 ~ The option on whether or not the annotation feature class should auto create new annotation features when a related feature is created (This option is not used if append mode=True and only applies for feature-linked annotation).
 ~ The option on whether or not the annotation feature class should auto update exiting annotation features when a related feature shape is changed (This option is not used if append mode=True and only applies for feature-linked annotation).
 ~ The configuration keyword to create the feature class with (This option is not used if append mode=True).

Append Mode:

If appendMode is True, the converter will look for the provided annotation class name in the specified workspace/feature dataset and convert labels to annotation features in that feature class. Append mode also performs additional logic to match existing annotation classes in the feature class with label classes being converted. If the classes match, they will be used rather than added to the annotation feature class extensions properties collection. If updates to the class extension are needed, an exclusive schema lock is required and an attempt will be made to obtain one.

If appendMode is false, a new annotation feature class will be created in specified workspace and feature dataset with the specified name and parameters as listed above.

See Also

IConvertLabelsToAnnotation Interface

.NET Related Topics

Converting labels to geodatabase annotation for a single layer | Converting labels to geodatabase annotation for an entire map | Converting labels to map annotation for a single layer