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
You can enter the name of the subtype value to which you want a topology rule to be applied.
Syntax
arcpy.management.AddRuleToTopology(in_topology, rule_type, in_featureclass, {subtype}, {in_featureclass2}, {subtype2})
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 topology rules 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 |
Derived Output
Name | Explanation | Data Type |
out_topology | The updated topology. | Topology Layer |
Code sample
AddFeatureClassToTopology example (stand-alone script)
The following stand-alone script demonstrates how to use the AddRuleToTopology function.
# Name: AddRuleToTopology_Example.py
# Description: Adds a rule to a topology
# Import system modules
import arcpy
# Any intersection of ParcelOutline (BlockLines subtype only) needs to be reviewed
arcpy.AddRuleToTopology_management("C:/data/Landbase.gdb/LegalFabric/topology",
"Must Not Intersect (Line)",
"C:/data/Landbase.gdb/LegalFabric/ParcelOutline",
"BlockLines")
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes