Skip To Content

esri_featurelayer_elevatetofield (AutoLISP)

The (esri_featurelayer_elevatetofield) function modifies the z-coordinates of the entities of the specified feature layer and any TEXT entities linked to those features.

Function details:

  • If no selection set is included, all features of the feature layer will be modified.
  • This function supports entities from POINT, POLYLINE, POLYGON, and ANNOTATION feature layers.

Syntax

(esri_featurelayer_elevatetofield flname field [elevation_settings])

Arguments

List of arguments for the function:

  • flname | string | required | An existing feature layer name in the drawing.
  • field | string | required | A numeric feature attribute field.
  • elevation_settings | associated list | optional | A list of optional settings as dotted pairs to modify how the elevations will be modified.

    Associated labelValue typeValue descriptionRequired or optional
    "FIELDUNITS"

    string

    "Feet", "USFeet" or "Meters" (case insensitive).

    Optional (default "Meters")

    "ZFACTOR"

    double

    Multiplies each feature's FIELD value by this amount to determine elevation. Overrides FIELDUNITS.

    Optional (default 1.0)

    "SELECTIONSET"

    selection set

    AutoCAD selection set to limit which of the features will be modified. If omitted, all features of the feature layer will be modified.

    Optional (default ALL features of feature layer)

Example usage 1

This example modifies the elevation of all the features of the Contours feature layer based the feature attribute field called ELEVATION where the units of the values are in meters.

(esri_featurelayer_elevatetofield "Contours" "ELEVATION")

Result example usage 1

Modifies the elevation of all of the features of the Contours feature layer based the values of the attribute field called ELEVATION and returns a list of true with the count of features modified.

(T 49)

Example usage 2

This example modifies the elevation of a selected set of features of the Spot_Elevation feature layer and where the elevations stored in the ELEVATION field need to be multiplied by a scale factor to account for a conversion of meters to feet.

(progn
(setq ss (ssget))
(esri_featurelayer_elevatetofield "Spot_Elevation" "ELEVATION"
  (list
    (cons "ZFACTOR" 3.28084)
    (cons "SELECTIONSET" ss)
)))

Result example usage 2

Modifies the elevation of the selected set of spot elevation features based on the supplied scaling factor, and returns a list of true with the count of features modified. :

(T 20)

Return values

  • If successful, returns a list of true and the count of entities modified: (T <n>)
  • 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 of the required arguments are not supplied.

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

    The specified feature layer was not found in the drawing.

  • (nil ("Error" . "No supported feature layers found."))

    Layer has a geometry type of MULTIPATCH which is not supported.

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

    Missing or field name not found, or invalid elevation_settings.