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.
The function details are as follows::
- 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
- 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 defined as follows:
Associated label Value type Value description Required or optional "ZFACTOR" double
Multiplies each feature's FIELD value by this amount to determine elevation. This argument overrides FIELDUNITS.
Optional (default 1.0)
"FIELDUNITS" string
The unit of measurement for elevation. Valid values are "Feet", "USFeet", and "Meters" (these are not case sensitive).
Optional (ignored when ZFACTOR is present)
"SELECTIONSET" selection set
An AutoCAD selection set that limits which of the features will be modified. If no value is provided, all features of the feature layer will be modified.
Optional (default All features of the feature layer)
Example usage 1
This example modifies the elevation of all the features of the Contours feature layer based on the ELEVATION feature attribute field in which the units of the values are meters.(esri_featurelayer_elevatetofield "Contours" "ELEVATION")
Result example usage 1
This example modifies the elevation of all the features of the Contours feature layer based on the values of the ELEVATION attribute field and returns a list of true with the count of the modified features.
(T 49)Example usage 2
This example modifies the elevation of a selected set of features of the Spot_Elevation feature layer, and 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
This example 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 modified features.
(T 20)Return values
The following are the possible return values:
- If successful, returns a list of true and the count of modified entities: (T <n>).
- If failed, 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" . "Cannot calculate unit scale factor from current coordinate system."))
The function could not resolve either the user specified units or the map's coordinate system units.
- (nil ("Error" . "Missing required
argument."))
One or more of the required arguments were 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."))
The layer has a geometry type of MULTIPATCH, which is not supported.
- (nil ("Error" . "Field not found."))
A field name was not found, or an invalid elevation_settings value was provided.