ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.Topology Namespace / TopologyRule Class / OriginClass Property
Example

In This Topic
    OriginClass Property (TopologyRule)
    In This Topic
    Gets the name of the origin feature class to which this topology rule is assigned.
    Syntax
    public string OriginClass {get;}
    Public ReadOnly Property OriginClass As String
    Example
    GetTopologyRules
    using (TopologyDefinition topologyDefinition = topology.GetDefinition())
    {
      IReadOnlyList<TopologyRule> rules = topologyDefinition.GetRules();
    
      Console.WriteLine($"There are {rules.Count} topology rules defined for the topology:");
      Console.WriteLine("ID \t Origin Class \t Origin Subtype \t Destination Class \t Destination Subtype \t Rule Type");
    
      foreach (TopologyRule rule in rules)
      {
        Console.Write($"{rule.ID}");
    
        Console.Write(!String.IsNullOrEmpty(rule.OriginClass) ? $"\t{rule.OriginClass}" : "\t\"\"");
    
        Console.Write(rule.OriginSubtype != null ? $"\t{rule.OriginSubtype.GetName()}" : "\t\"\"");
    
        Console.Write(!String.IsNullOrEmpty(rule.DestinationClass) ? $"\t{rule.DestinationClass}" : "\t\"\"");
    
        Console.Write(rule.DestinationSubtype != null ? $"\t{rule.DestinationSubtype.GetName()}" : "\t\"\"");
    
        Console.Write($"\t{rule.RuleType}");
    
        Console.WriteLine();
      }
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also