Listing Topology Rules Used (in user friendly format)

08-03-2017 02:02 PM
MVP Esteemed Contributor

I have an ArcSDE (SQL) database and Feature Dataset with multiple layers involved in a Topology, with about a dozen rules.  I've added a new FC and I'm now working on setting up and modifying the rules.

I know I can right-click the properties of the topology to see the rules, but I can't expand the properties box to see all three columns in full.  Saving the rules creates a binary (non-readable) .rul file.  I tried a select-all, copy/paste from the properties window but that does not work.

I know that a dozen rules isn't so much that I couldn't just right them down (which is what I willdo for now), but wondering if anyone has a tool or procedure for converting/viewing the .rul file as a a text file....or any other simple tool.

I figure this question with either be something simple I am missing, someone has a snazzy tool, or not work pursuing, but worth asking in case it's one of the first two. 


0 Kudos
2 Replies
MVP Esteemed Contributor

I will answer and close (unless someone finds an answer) with the answer that it isn't possible (feel free to prove me wrong).

But to summarize, I will include some tips and something that almost got me what I wanted....but really just proved it wasn't possible (maybe with ArcObjects, but I'm not going there).

import arcpy
import os
path = r"C:\ArcGIS\Default.gdb"

arcpy.env.workspace = path
gdb_objects = arcpy.ListDatasets(wild_card=None, feature_type='Feature')
print "Feature datasets are: " + str(gdb_objects) #only feature datasets are here
for obj in gdb_objects:
    fd_path = os.path.join(path,obj)
    arcpy.env.workspace = fd_path #get a new workspace pointed to the fd
    fd_objects = arcpy.ListDatasets(wild_card=None, feature_type='')

    for dataset in fd_objects: #iterate feature dataset objects
        desc_dataset = arcpy.Describe(dataset)
        if desc_dataset.datasetType == 'Topology': #finding out whether is topology
            print dataset

It gives the name of the topology, but no other info.  But with that, and pointing me to the properties (I'm including 10.3 links)

I could then list the feature classes that are in the topology

pathtoTopology = r'full path to topology'
descTopoFC = arcpy.Describe(pathtoTopology)

However, I could not find anything that would print the FeatureClass, Rule, and 2nd-FeatureClass (if applicable) as shown in the properties. 

So, closing this thread.  If anyone finds anything, I would be interested, but not worth spending more time on it for me right now.

0 Kudos
New Contributor II

I want to do the same, any ideas how to?

0 Kudos