ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMFeatureSortInfo Class
Members Example

In This Topic
    CIMFeatureSortInfo Class
    In This Topic
    Contains information about the field name and sort order used to draw features.
    Object Model
    CIMFeatureSortInfo ClassCIMFeatureSortInfo ClassCIMFeatureSortInfo Class
    Syntax
    Example
    Set Feature Drawing Order 2
    {
        //Within QueuedTask.Run()
        if (featureLayer.GetIsFeatureDrawOrderSupported())
        {
            var listOfSortInfo = new List<CIMFeatureSortInfo>
            {
                //Draw features in the layer ordered by Police_Precinct field in ascending order
                //and then by Crime_rate field in descending order
                new CIMFeatureSortInfo
                {
                    FieldName = "Police_Precinct",
                    SortDirection = SortOrderType.Ascending
                },
                new CIMFeatureSortInfo
                {
                    FieldName = "Crime_rate",
                    SortDirection = SortOrderType.Descending
                }
            };
            //Provide the list of FSOs to use and their sort ordering
            //All fields must exist on the layer.
            if (featureLayer.GetCanSetFeatureDrawOrder(listOfSortInfo))
            {
                //Set the FDO to use the list of FSOs
                featureLayer.SetFeatureDrawOrder(listOfSortInfo);
            }
        }
    }
    Get the Current Feature Drawing Order
    {
        //Within QueuedTask.Run()
        if (featureLayer.GetIsFeatureDrawOrderSupported())
        {
            var cimFeatSortInfo = featureLayer.GetFeatureDrawOrder();
            var c = 0;
            System.Diagnostics.Debug.WriteLine("Feature Sort Info:");
            foreach (var fs_info in cimFeatSortInfo)
            {
                System.Diagnostics.Debug.WriteLine(
                  $"fs_info[{c++}] {fs_info.FieldName}: {fs_info.SortDirection.ToString()}");
            }
        }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.CIMFeatureSortInfo

    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.1 or higher.
    See Also