ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data Namespace / FeatureDataset Class / GetDefinition Method / GetDefinition() Method
Example

In This Topic
    GetDefinition() Method
    In This Topic
    Gets the FeatureDatasetDefinition of this dataset. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public new FeatureDatasetDefinition GetDefinition()
    Public Overloads Shadows Function GetDefinition() As FeatureDatasetDefinition

    Return Value

    The FeatureDatasetDefinition of this dataset.
    Exceptions
    ExceptionDescription
    This dataset does not have a valid definition.
    A geodatabase-related exception has occurred.
    Example
    Iterate datasets inside a feature dataset
    public void IterateDatasetsFromAFeatureDataset(Geodatabase geodatabase, string featureDatasetName = "City", string featureClassInFeatureDataset = "Buildings")
    {
      // Open a feature dataset
      using (FeatureDataset cityFeatureDataset = geodatabase.OpenDataset<FeatureDataset>(featureDatasetName))
      {
        // Get a feature class definition from a feature dataset
        FeatureClassDefinition buildingsFeatureClassDefinition = cityFeatureDataset.GetDefinition<FeatureClassDefinition>(featureClassInFeatureDataset);
    
        // Iterate dataset definition
        IReadOnlyList<FeatureClassDefinition> cityFeatureClassDefinitions = cityFeatureDataset.GetDefinitions<FeatureClassDefinition>();
        foreach (FeatureClassDefinition cityFeatureClassDefinition in cityFeatureClassDefinitions)
        {
          // Use feature class definition
        }
      }
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also