Skip To Content

esri_feature_changeElementType (AutoLISP)

The esri_feature_changeElementType function changes the element type of a selection set of point, multipoint, or polygon features.

Syntax

(esri_feature_changeElementType selection_set element_settings)

Arguments

  • selection_set | AutoCAD selection set | required | A valid selection set of features.
  • element_settings | associated list | required | An associated list of settings as dotted pairs defined as follows:

Associated labelValue typeValue descriptionRequired or optional
"Type"

string

The default element type of POINT, Block Reference, or AECC_COGO_POINT for point and multipoint feature layers, and Automatic or Hatch for polygon feature layers. Automatic will omit any hatch symbology on polygon features.

Required

"Description"

string

The block name if the type is Block Reference, a description prefix if the type is AECC_COGO_POINT, or the hatch pattern name for polygons.

Required if Block Reference or AECC_COGO_POINT

Example usage

Change the element settings of the selected set with an AutoCAD block insert named Damaged_Structure.

(esri_feature_changeElementType 
  (setq ss (ssget))
  (list (cons "Type" "Block Reference") (cons "Description" "Damaged_Structure"))
)

Result example usage

Changes the element type of the selected features and returns a list of true:

(T)

Return values

The following are the possible return values:

  • If successful, it returns a list of true: (T).
  • If failed, it returns a list with the first value of nil; then, an associated list is returned 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" . "Missing required argument."))

    One of the three required arguments was not provided.

  • (nil ("Error" . "Incorrect argument."))

    An invalid argument was supplied to function.

  • (nil ("Error" . "Block name does not exist."))

    The specified block name in the Description does not exist in the drawing.