ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.CIM Namespace / MaplexPolygonFeatureType Enumeration
Example Example

In This Topic
    MaplexPolygonFeatureType Enumeration
    In This Topic
    Maplex polygon feature types.
    Syntax
    public enum MaplexPolygonFeatureType : System.Enum, System.IComparable, System.IConvertible, System.IFormattable  
    Public Enum MaplexPolygonFeatureType 
       Inherits System.Enum
       Implements System.IComparable, System.IConvertible, System.IFormattable 
    Members
    MemberDescription
    Boundary Boundary polygon placement.
    General General polygon placement.
    LandParcel Land parcel polygon placement.
    River River polygon placement.
    Example
    Modify the Placement/Position of labels - Polygon geometry
    //Note: call within QueuedTask.Run()
    
    //Get the layer's definition
    var lyrDefn = featureLayer.GetDefinition() as CIMFeatureLayer;
    //Get the label classes - we need the first one
    var listLabelClasses = lyrDefn.LabelClasses.ToList();
    var theLabelClass = listLabelClasses.FirstOrDefault();
    //Modify label Placement 
    //Check if the label engine is Maplex or standard.
    CIMGeneralPlacementProperties labelEngine = MapView.Active.Map.GetDefinition().GeneralPlacementProperties;
    if (labelEngine is CIMStandardGeneralPlacementProperties)
    {
      //Current labeling engine is Standard Labeling engine
      theLabelClass.StandardLabelPlacementProperties.PolygonPlacementMethod = 
               StandardPolygonPlacementMethod.AlwaysHorizontal;
      theLabelClass.StandardLabelPlacementProperties.PlaceOnlyInsidePolygon = true;
    }
    else
    {
      //Current labeling engine is Maplex labeling engine
      theLabelClass.MaplexLabelPlacementProperties.PolygonFeatureType = 
                               MaplexPolygonFeatureType.LandParcel;
      theLabelClass.MaplexLabelPlacementProperties.AvoidPolygonHoles = true;
      theLabelClass.MaplexLabelPlacementProperties.PolygonPlacementMethod = 
                          MaplexPolygonPlacementMethod.HorizontalInPolygon;
      theLabelClass.MaplexLabelPlacementProperties.CanPlaceLabelOutsidePolygon = true;
    }
    
    lyrDefn.LabelClasses = listLabelClasses.ToArray(); //Set the labelClasses back
    featureLayer.SetDefinition(lyrDefn); //set the layer's definition
                                         //set the label's visiblity
    featureLayer.SetLabelVisibility(true);
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Core.CIM.MaplexPolygonFeatureType

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also