SoFunction
Updated on 2025-03-01

C# Use AE to get the properties and field operations of feature

I won't say much nonsense, let's just read the code~

public static DataTable GetFeatureDataTable(IFeature pFeature)
    {
      DataTable dt = new DataTable();
      ("Location:");
      ("data:");
      for (int i = 0; i < ; i++)
      {
        DataRow dr = ();
        dr[0] = [i].Name;
        dr[1] = [i];
        (dr);
      }
      return dt;
    }

Supplement: C#AE gets the unique value of a field in the feature layer

Start:

IFeatureLayer featureLayer=You want to get the layer with unique values
//Storage unique value fieldList<string> myValueList = new List<string>();
#region//Get unique value field//Data statisticsIDataStatistics dataStatistics = new DataStatisticsClass();
//Set statistics field = fieldName;
//Get all = (ICursor)(null, false);
IEnumerator myEnumerator = ;
//Get the unique value field of this field();
while (())
{
     if (!(()))
      {
           (());
      }
}
//Release the pointer (release after use, develop good habits)(dataStatistics);
#endregion

End.

The above is personal experience. I hope you can give you a reference and I hope you can support me more. If there are any mistakes or no complete considerations, I would like to give you advice.