Skip To Content

esri_featurelayer_featurecount (AutoLISP)

The esri_featurelayer_featurecount function returns the total number of features of a feature layer in the drawing. Use this function to count the number of document or web feature layer features of the specified feature layer are in the drawing.

Syntax

(esri_featurelayer_featurecount flname [subtype])

Arguments

  • flname | string | required | An existing document or web feature layer name defined in the drawing.
  • subtype | string | optional | An existing feature layer subtype name in the drawing.

Example usage 1

Request the number of features of the Shelters feature layer that are currently in the drawing.

(esri_featurelayer_featurecount "Shelters")

Result example usage 1

Return the number of features in the Shelters feature layer currently in the drawing as an integer.

15

Example usage 2

Request the number of features of the Shelters feature layer currently in the drawing.

(esri_featurelayer_featurecount "shelters" "Open")

Result example usage 2

Return the number of features in the Shelters feature layer with the Open subtype currently in the drawing as an integer.

11

Return values

  • If successful, returns the requested count of features.
  • If failed, returns a list with the first value of nil and 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 feature layer specified was not found in the drawing.

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

    The specified sublayer does not exist in the file.

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

    The required feature layer name was not specified.