ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Add Rule To Topology

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

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

    Legacy:
    Prior to ArcGIS 10.1 for Desktop, rules could not be added to a versioned topology. In ArcGIS 10.1 you can add rules to a versioned topology when the ArcSDE geodatabase is version 10.0 or higher. To upgrade your geodatabase to the latest version, use the Upgrade_Geodatabase tool.

  • You can enter the name of the subtype value to which you want a topology rule to be applied.

Syntax

AddRuleToTopology_management (in_topology, rule_type, in_featureclass, {subtype}, {in_featureclass2}, {subtype2})
ParameterExplanationData 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

AddFeatureClassToTopology 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:/Landbase.mdb/LegalFabric/topology", 
                                   "Must Not Intersect (Line)",
                                   "C:/Landbase.mdb/LegalFabric/ParcelOutline",
                                   "BlockLines",
                                   "", 
                                   "", )

Environments

  • Current Workspace

Licensing information

  • ArcGIS for Desktop Basic: No
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • Topology basics
  • Topology in ArcGIS
  • Designing a geodatabase topology

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal