ListContingentValues

Synthèse

The ListContingentValues function lists the contingent values on a table. Search conditions can be specified for the field group name and subtype to limit the list that is returned.

Syntaxe

ListContingentValues (table, {field_group_name}, {subtype_code})
ParamètreExplicationType de données
table

A table that has contingent values.

String
field_group_name

The field group name to limit the results returned. Only contingent values for the field group specified will be returned.

(La valeur par défaut est All)

String
subtype_code

The subtype code to limit the results returned. Only contingent values for the subtype specified will be returned.

(La valeur par défaut est All)

Long
Valeur renvoyée
Type de donnéesExplication
Object

A list of ContingentValue objects. Each object contains properties of the contingent value.

Exemple de code

ListContingentValues example

List and describe the contingent value properties for a field group named MyFieldGroup.

import arcpy
CVs = arcpy.da.ListContingentValues("C:\\MyProject\\myConn.sde\\mygdb.USER1.myFC", "MyFieldGroup")
for cv in CVs:
    print("Subtype: {}\nIs retired: {}\nContingent Value Id: {}\nValues: \n".format(cv.subtype, cv.isRetired, cv.id))
    for v in cv.values:
        print(" Field Name: {}\n Field Value Type: {}""".format(v.name, v.type))
        if v.type == "CODED_VALUE":
            print(" Field Value Code: {}\n".format(v.code))
        if v.type == "RANGE":
            print(" Field Range: {}\n".format(v.range))

Rubriques connexes