Skip To Content

esri_fielddef_get (AutoLISP)

This function gets the feature layer field properties of a feature layer as an associated list.

Syntax

(esri_fielddef_get flname field [subtype])

Arguments

  • flname | string | required | An existing feature layer name in the drawing.
  • field | string | required | The field name.
  • subtype | string | optional | The subtype name is required if you want to get appropriate field definitions for the target subtype which can differ from the parent feature layer.

Example usage

Attempt to get the field properties for the PoleType field of the steel subtype of the UtilityPoles feature layer.

(esri_fielddef_get "UtilityPoles" "PoleType" "steel")

Result example usage

Returns the field properties for the PoleType field of the steel subtype of the UtilityPoles feature layer as an associated list.

(("NAME" . "PoleType") ("TYPE" . "Short") ("READONLY" . 0) ("LENGTH" . -1) ("VALUE" . 0) ("DOMAIN" . "UtilityPoles_TypeDomain"))

Return values

The following are the possible return values:

  • If successful, returns the field properties as an associated list of dotted pairs defined as follows:
    • "NAME"| string | Returns the field name.
    • "TYPE" | string | Returns the field type value {"Double", "Integer", "Short", "String"}.
    • "READONLY" | string | Returns whether the field is read-only {1= yes, 0 = no}.
    • "LENGTH" | integer | Returns the length of the field.
    • "VALUE" | variant | Returns the default value of the field definition. If the field has a coded value domain, this is the index value, not the descriptive value.
    • "DOMAIN" | string | The name of the domain definition for the field.
  • If failed, it returns a list with the first value of nil and then an associated list containing the key value "Error" and an associated error message as a string: (nil ( "Error" . "<message>")).

Failed return values

Failed return values can occur for any of the following reasons:

  • (nil ("Error" . "Field not found"))

    The specified field was not found on the specified feature layer.

  • (nil ("Error" . "Feature layer not found."))

    The specified feature layer value is not a valid feature layer in the drawing.

  • (nil ("Error" . "Missing required argument."))

    The required argument was not supplied.