Add Rule To Topology (Data Management)
Summary
Adds a new rule to a topology.
The rules you choose to add depend on the spatial relationships that you wish to monitor for the feature classes that participate in the topology.
For a complete list and description of the available topology rules see Geodatabase topology rules and topology error fixes
Usage
-
To add a rule to a topology, the input topology cannot be registered as versioned.
-
You can enter the name of the subtype value to which you want a topology rule to be applied.
Syntax
Parameter | Explanation | Data Type |
in_topology |
The topology to which the new rule will be added. | Topology Layer |
rule_type |
The topology rule to be added. For a complete list of the rules and what they do, see the tool's help page. | String |
in_featureclass |
The input or origin feature class. | Feature Layer |
subtype (Optional) |
The subtype for the input or origin feature class. Enter the subtype's description (not the code). If subtypes do not exist on the origin feature class, or you want the rule to be applied to all subtypes in the feature class leave this blank. | String |
in_featureclass2 (Optional) |
The destination feature class for the topology rule. | Feature Layer |
subtype2 (Optional) |
The subtype for the destination feature class. Enter the subtype's description (not the code). If subtypes do not exist on the origin feature class, or you want the rule to be applied to all subtypes in the feature class leave this blank. | String |
Code Sample
The following stand-alone script demonstrates how to use the AddRuleToTopology function.
# Name: AddRuleToTopology_Example.py # Description: Adds a rule to a topology # Author: ESRI # Import system modules import arcpy # Any intersection of ParcelOutline (BlockLines subtype only) needs to be reviewed arcpy.AddRuleToTopology_management("C:/Landbase.mdb/LegalFabric/topology", "Must Not Intersect (Line)", "C:/Landbase.mdb/LegalFabric/ParcelOutline", "BlockLines", "", "", )