Skip To Content

esri_featurelayer_select (AutoLISP)

This function returns an AutoCAD selection set filtered by the specified feature layer and optional subtype from the drawing, and optionally specified selection set. This function is similar to Objects option of the Select Features tool on the context menu of a web feature layer or document feature layer in the Esri Contents pane.

Syntax

(esri_featurelayer_select flname subtype [select_settings])

Arguments

  • flname | string | required | An existing web feature layer or document feature layer name in the drawing.
  • subtype | string | required | Subtype name of the feature layer, or empty string "" for all subtypes or if there are no subtypes.
  • select_settings | associated list | optional | List of optional settings as dotted pairs to limit the selection set by attribute query and preselection.

    Associated labelValue typeValue descriptionRequired or optional
    "SSET"

    AutoCAD selection set object

    An AutoLISP selection set object. The AutoCAD AutoLISP function (ssget) can be used to prompt the user to select entities for this function. If the selection set is omitted, all of the features of the feature layer of the specified subtype will be included in the returned selection set as will all AutoCAD selection sets. It is best practice to release the resources used by all selection sets after using them. You can do this by setting selection sets to nil after use.

    optional

    "ATTRIBUTEQUERY"

    string

    A where clause using a single field name to limit returned value to this one field. If the flname is also supplied, the field name included in the where clause string must exist in that feature class definition.

    optional

Example usage 1

Attempt to create a selection set all of the entities that belong to the Shelters feature layer in the current drawing:

(esri_featurelayer_select "Shelters" "")

Result example usage 1

A selection set of all the entities that belong to the Shelters feature layer is returned:

<Selection set: 2e>

Example usage 2

Attempt to create a selection set all of the entities that belong to subtype 1 of the Shelters feature layer in the current drawing where the capacity field values are greater than 400:

(esri_featurelayer_select "Shelters" "1"
  (list (cons "ATTRIBUTEQUERY" "capacity > 400"))
)

Result example usage 2

Returns a selection set all of the entities that belong to subtype 1 of the Shelters feature layer in the current drawing where the capacity field values are greater than 400:

<Selection set: 30>

Return values

  • If successful, returns an AutoCAD selection set object.
  • 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" . "Missing required argument."))

    One or more required arguments is not supplied.

  • (nil ("Error" . "No feature layer specified."))

    The required feature layer value was not valid or missing.

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

    The required subtype name was not valid or missing.

See also

(esri_featurelayer_selectspecial)