Select to view content in your preferred language

How to get all relationshipclass properties using Python

803
3
01-09-2013 04:09 AM
StevePeaslee
Deactivated User
I need to get all the properties for a geodatabase relationshipclass. I can use a Python script to get most of the properties via the geoprocessing "Describe" but unless I'm missing something, the names of the primary and foreign key fields aren't exposed to this method.

Can someone please point me in the right direction? There has to be a way.

-Steve
0 Kudos
3 Replies
brettangel
Frequent Contributor
Did you ever find a solution to this?
0 Kudos
JillianPenney
Esri Contributor
At 10.2.1 release, it will be possible to obtain the origin and destination class keys via python using the Describe function.

You can use:
arcpy.Describe(<relationshipclass>).OriginClassKeys  or
arcpy.Describe(<relationshipclass>).DestinationClassKeys


The result returned will look something like this:
[(u'OBJECTID', u'OriginPrimary', u''), (u'ParcelID', u'OriginForeign', u'')]
[(u'id', u'DestinationPrimary', u''), (u'RenterID', u'DestinationForeign', u'')]


Hope this helps!
0 Kudos
StevePeaslee
Deactivated User
Thanks Jill! Just have to be patient I guess.

-Steve
0 Kudos