ITopologyRule Interface

Provides access to memebers that return information about topology rules.

When To Use

The ITopologyRule is the main interface for creating and getting information about a topology rule. Use this interface to create a new topology rule between feature classes or for a single feature class. Topology rules can also be specified to the subtype level.

Members

Name Description
Read/write property AllDestinationSubtypes Indicates if all destination subtypes are specified for the topology rule.
Read/write property AllOriginSubtypes Indicates if all origin subtypes are specified for the topology rule.
Read/write property DestinationClassID Destination ClassID of the topology rule.
Read/write property DestinationSubtype Destination subtype of the topology rule.
Read-only property DestinationSubtypeSpecified Indicates if a destination subtype has been specified.
Method ErrorShapeTypes Indicates the shape types of errors for the topology rule.
Read-only property GUID GUID of the topology rule.
Read/write property Name Name of the topology rule.
Read/write property OriginClassID Origin ClassID of the topology rule.
Read/write property OriginSubtype Origin subtype of the topology rule.
Read-only property OriginSubtypeSpecified Indicates if an origin subtype has been specified.
Read/write property TopologyRuleType Topology rule type of the topology rule.
Read/write property TriggerErrorEvents Indicates if error events are triggered for the topology rule.

ITopologyRule.AllDestinationSubtypes Property

Indicates if all destination subtypes are specified for the topology rule.

Public Property AllDestinationSubtypes As Boolean
public bool AllDestinationSubtypes {get; set;}

Remarks

AllDestinationSubtypes specifies if the rule applies to all subtypes in the destination feature class. By default, AllDestinationSubtypes is False, and the DestinationSubtype property is set to -1. If the destination class contains subtypes, and these values are not changed, adding the rule to the topology will fail.

AllDestinationSubtypes is set to the opposite value of DestinationSubtypeSpecified. If the topology rule is a single feature class type, AllDestinationSubtypes is set to True once the rule is added to the topology.

ITopologyRule.AllOriginSubtypes Property

Indicates if all origin subtypes are specified for the topology rule.

Public Property AllOriginSubtypes As Boolean
public bool AllOriginSubtypes {get; set;}

Remarks

AllOriginSubtypes specifies if the rule applies to all subtypes in the origin feature class. By default, AllOriginSubtypes is False, and the OriginSubtype property is set to -1. If the origin class contains subtypes, and these values are not changed, adding the rule to the topology will fail.

AllOriginSubtypes is set to the opposite value of OriginSubtypeSpecified. If the topology rule is a single feature class type, AllOriginSubtypes is set to True once the rule is added to the topology.

ITopologyRule.DestinationClassID Property

Destination ClassID of the topology rule.

Public Property DestinationClassID As Integer
public int DestinationClassID {get; set;}

Remarks

The DestinationClassID of the topology rule. If the topology rule is a single feature class type, the DestinationClassID does not need to be set, and it will be equal to the OriginClassID by default. If DestinationClassID is specified, it will be ignored.

ITopologyRule.DestinationSubtype Property

Destination subtype of the topology rule.

Public Property DestinationSubtype As Integer
public int DestinationSubtype {get; set;}

Remarks

The DestinationSubtype specifies the destination subtype of the topology rule. If AllDestinationSubtypes is set to True, the DestinationSubtype is ignored. If DestinationSubtype is set to -1, AllDestinationSubtypes will return True. If the assigned value does not correspond to a valid subtype, an error will be raised when the rule is added to the topology.

ITopologyRule.DestinationSubtypeSpecified Property

Indicates if a destination subtype has been specified.

Public ReadOnly Property DestinationSubtypeSpecified As Boolean
public bool DestinationSubtypeSpecified {get;}

Remarks

The DestinationSubtypeSpecified will return True whenever the rule has been specified at the subtype level using ITopologyRule::DestinationSubtype. The DestinationSubtypeSpecified is the opposite of ITopologyRule::AllDestinationSubtypes.

ITopologyRule.ErrorShapeTypes Method

Indicates the shape types of errors for the topology rule.

Public Sub ErrorShapeTypes ( _
    ByRef multipoints As Boolean, _
    ByRef polylines As Boolean, _
    ByRef polygons As Boolean _
)
public void ErrorShapeTypes (
    ref bool multipoints,
    ref bool polylines,
    ref bool polygons
);

Remarks

The ErrorShapeTypes method returns the supported error geometries for the specific topology rule. If a topology rule does not support multi-points, this parameter equates to points. Every topology rule supports the creation of point topology errors.

ITopologyRule.GUID Property

GUID of the topology rule.

Public ReadOnly Property GUID As String
public string GUID {get;}

Remarks

A GUID uniquely identifies each topology rule, and it is assigned when the rule is added to the topology using ITopologyRuleContainer::AddRule. The GUID is also used to get the topology rule using ITopologyRuleContainer::RulebyGUID.

ITopologyRule.Name Property

Name of the topology rule.

Public Property Name As String
public string Name {get; set;}

Remarks

The Name property can be used to assign a user-specified string to each rule. By default, the Name property is empty.

ITopologyRule.OriginClassID Property

Origin ClassID of the topology rule.

Public Property OriginClassID As Integer
public int OriginClassID {get; set;}

Remarks

The OriginClassID of the topology rule.

ITopologyRule.OriginSubtype Property

Origin subtype of the topology rule.

Public Property OriginSubtype As Integer
public int OriginSubtype {get; set;}

Remarks

The origin subtype of a topology rule. If AllOriginSubtypes is set to True, the OriginSubtype is ignored. If OriginSubtype is set to -1, AllOriginSubtypes will return True. If the assigned value does not correspond to a valid subtype, an error will be raised when the rule is added to the topology.

ITopologyRule.OriginSubtypeSpecified Property

Indicates if an origin subtype has been specified.

Public ReadOnly Property OriginSubtypeSpecified As Boolean
public bool OriginSubtypeSpecified {get;}

Remarks

The ITopologyRule::OriginSubtypeSpecified property will return True whenever the rule has been specified at the subtype level with the use of ITopologyRule::OriginSubtype. The OriginSubtypeSpecified is the opposite of ITopologyRule::AllOriginSubtypes.

ITopologyRule.TopologyRuleType Property

Topology rule type of the topology rule.

Public Property TopologyRuleType As esriTopologyRuleType
public esriTopologyRuleType TopologyRuleType {get; set;}

Remarks

A value from the esriTopologyRuleTypeenumeration that represents the rule's type.

ITopologyRule.TriggerErrorEvents Property

Indicates if error events are triggered for the topology rule.

Public Property TriggerErrorEvents As Boolean
public bool TriggerErrorEvents {get; set;}

Remarks

The TriggerErrorEvents property is not currently in use and is reserved for future use.

Classes that implement ITopologyRule

Classes Description
TopologyRule Esri Topology Rule object.

Remarks

The ITopologyRule interface provides access to members which can be used to assign or retrieve information about a topology rule. Topology rules are cocreateable.

To be added to a topology, a rule must have (at a minimum) its Type and OriginClassID properties defined. Rules which use a destination feature class must also have the DestinationClassID property set.

When specifying the Origin properties, if the OriginSubtype, OriginSubtypeSpecified and AllOriginSubtypes are not specified, the OriginSubtype is set to the default subtype. If no subtypes are defined on the feature class, the OriginSubtype will equal zero. The same is true for the DestinationSubtype, DestinationSubtypeSpecified and AllDestinationSubtypes properties.

// Create a rule

ITopologyRule topologyRule = new TopologyRuleClass()

{

    AllOriginSubtypes = true,

    TopologyRuleType = esriTopologyRuleType.esriTRTAreaNoOverlap,

    Name = "No Overlap Rule",

    TriggerErrorEvents = true

};

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.