关系类属性

摘要

Describe 函数可返回关系类的以下属性。同时还支持表属性数据集属性

关系类可返回“RelationshipClass”dataType

属性

属性说明数据类型
backwardPathLabel
(只读)

The backward path label for the relationship class.

String
cardinality
(只读)

The cardinality for the relationship class.

  • OnetoOne
  • OneToMany
  • ManyToMany
String
classKey
(只读)

Class key used for the relationship class.

  • Undefined
  • ClassID
  • ClassCode
String
destinationClassNames
(只读)

A Python List containing the names of the destination classes.

String
forwardPathLabel
(只读)

The forward path label for the relationship class.

String
isAttachmentRelationship
(只读)

Indicates if the relationship class represents a table attachment.

Boolean
isAttributed
(只读)

Indicates if the relationships in this relationship class have attributes.

Boolean
isComposite
(只读)

Indicates if the relationship class represents a composite relationship in which the origin object class represents the composite object.

Boolean
isReflexive
(只读)

Indicates if the origin and destination sets intersect.

Boolean
keyType
(只读)

Key type for the relationship class.

  • Single
  • Dual
String
notification
(只读)

The notification direction for the relationship class.

  • None
  • Forward
  • Backward
  • Both
String
originClassNames
(只读)

A Python List containing the names of the origin classes.

String

代码示例

RelationshipClass properties example (stand-alone script)

The following stand-alone script displays properties for a relationship class.

import arcpy

# Create a Describe object
#
desc = arcpy.Describe("C:/data/moad.gdb/West/bapCompAttRel")

# Print relationship class properties
#
print "%-25s %s" % ("Backward Path Label:", desc.backwardPathLabel)
print "%-25s %s" % ("Cardinality:", desc.cardinality)
print "%-25s %s" % ("Class key:", desc.classKey)
print "%-25s %s" % ("Destination Class Names:", desc.destinationClassNames)
print "%-25s %s" % ("Forward Path Label:", desc.forwardPathLabel) 
print "%-25s %s" % ("Is Attributed:", desc.isAttributed)
print "%-25s %s" % ("Is Composite:", desc.isComposite) 
print "%-25s %s" % ("Is Reflexive:", desc.isReflexive)
print "%-25s %s" % ("Key Type:", desc.keyType)
print "%-25s %s" % ("Notification Direction:", desc.notification)
print "%-25s %s" % ("Origin Class Names:", desc.originClassNames)


7/10/2012