Skip To Content

esri_label_generate (AutoLISP)

The esri_label_generate function generates labels for the selected features of the specified feature layer using values from the specified attribute field. Optional text parameters can be used to offset the text and override the default text size. You can link feature attribute field values to most kinds of feature attribute fields. You cannot link reporting fields to text, or block attribute values.

Syntax

(esri_label_generate flname field [label_properties])

Arguments

  • flname | string | required | An existing web feature layer name in the drawing.
  • field | string | required | Feature layer field name associated with the label.
  • label_properties | associated list | optional | An associated list of feature layer field properties as dotted pairs as defined in the following table:

Associated labelValue typeValue descriptionRequired/Optional
"OFFSET"

list of three doubles

A list of three doubles that includes the offset distance from the standard label point in the x-direction, y-direction, and z-direction

optional

"TEXTSIZE"

double

The text size of the generated labels

optional

Example usage

Generate labels for the Owner field of the Parcels feature layer, where the text is offset 10 units up and to the right of the default label point with a text size of 7 units.

(esri_label_generate "Parcels" "Owner"
  (list
  (cons "OFFSET" '(10 10 0))
  (cons "TEXTSIZE" 7.0)
  )
)

Result example usage

Generates text entities as a linked labels and returns a list of true:

(T)

Return values

  • If successful the function returns a list of true: (T)
  • If failed, 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

A failed return value can occur for any of the following reasons:

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

    The specified file was not found.

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

    The source feature layer field does not exist in the drawing.

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

    One or more required arguments was not supplied.