Skip To Content

esri_attributes_set (AutoLISP)

This function adds or modifies feature attributes on an entity of a feature layer. If the field exists on the entity, and the specified field type matches the supplied value, it overwrites the existing value.

Note:

Some fields may be read-only. See the Field attributes topic for more information.

Syntax

(esri_attributes_set ename flname settings_list)

Arguments

  • ename | string | required | The AutoCAD entity name of the feature.
  • flname | string | required | An existing feature layer name in the drawing.
  • settings_list | associated list | required | An associated list of field names and values as dotted pairs.

    Associated labelValue typeValue descriptionRequired/Optional
    "<field name>"

    variant

    Name and value of the field.

    Note:

    When working with fields that have coded domain values, use the field description value and not the code.

    Required

    ...

    ...

    ...

    Optional

Example usage

Set the StreetName, Pavement, and Rating attribute values of the last created Centerlines feature entity.

(esri_attributes_set 
   (entlast) 
   "Centerlines"
   (list 
     (cons "StreetName" "Main") 
     (cons "PAVEMENT"  2) 
     (cons "Rating" 0.852)
  ))

Result example usage

Sets the StreetName, Pavement, and Rating attribute values of the last created Centerlines feature entity, and returns a list of true:

(T)

Return values

The following are the possible return values:

  • If successful, the function returns a list of true: (T)
  • 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" . "Missing required argument."))

    One of the required arguments was not supplied.

  • (nil ("Error" . "No valid fields specified."))

    The specified field is not a valid field of 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" . "Invalid value for attribute."))

    The value entered, or its formatting is invalid for the specified field type.