desc = arcpy.Describe("myTable") print desc.relationshipClassNames
import arcpy from arcpy import env workspace = env.workspace = r'your_workspace' def detectRelationship(): rc_list = [c.name for c in arcpy.Describe(workspace).children if c.datatype == "RelationshipClass"] for rc in rc_list: rc_path = workspace + "\\" + rc des_rc = arcpy.Describe(rc_path) origin = des_rc.originClassNames destination = des_rc.destinationClassNames print "Relationship Class: %s \n Origin: %s \n Desintation: %s" %(rc, origin, destination) detectRelationship()
Solved! Go to Solution.
import arcpy fc = r'\\nlbltfs01\Projecten\307103\werkdir\fgb\BLS_Copy_Paste.gdb\Leiding' arcpy.MakeFeatureLayer_management(fc,"myLayer") desc = arcpy.Describe("myLayer") print "myLayer: {0}".format(desc.relationshipClassNames)
tbl = r'\\nlbltfs01\Projecten\307103\werkdir\fgb\BLS_Copy_Paste.gdb\Persoon' arcpy.MakeTableView_management(tbl,"myTable") desc = arcpy.Describe("myTable") print "myTable: {0}".format(desc.relationshipClassNames)
import arcpy fc = r'\\nlbltfs01\Projecten\307103\werkdir\fgb\BLS_Copy_Paste.gdb\Leiding' arcpy.MakeFeatureLayer_management(fc,"myLayer") desc = arcpy.Describe("myLayer") print "myLayer: {0}".format(desc.relationshipClassNames)
tbl = r'\\nlbltfs01\Projecten\307103\werkdir\fgb\BLS_Copy_Paste.gdb\Persoon' arcpy.MakeTableView_management(tbl,"myTable") desc = arcpy.Describe("myTable") print "myTable: {0}".format(desc.relationshipClassNames)