The FeatureLayer.ElevateToField method modifies the z-coordinates of the entities of the specified feature layer and any TEXT entities linked to those features.
- 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.
Declaration
public int? Esri.ArcGISForAutoCAD.FeatureLayer.ElevateToField(Document doc, string flName, string field, string fieldUnits = null, double? zFactor = null, SelectionSet selectionSet = null)
Parameters
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
string | flName | An existing feature layer name in the drawing. | required |
string | field | A numeric feature attribute field. | required |
string | fieldUnits | The measurement unit: "Feet", "USFeet", or "Meters". | optional (default set to your map units) |
double | zFactor | The amount that each feature's field value is multiplied by to determine elevation. This parameter overrides the fieldUnits parameter. | optional (default 1.0) |
SelectionSet | selectionSet | The AutoCAD selection set used to limit 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) |
Returns
| Type | Description |
|---|---|
int? | The count of the entities modified. |
Remarks on error conditions
This method can throw an exception or may return 0 or null if a parameter is invalid.
Example 1
Modify the elevation of all the features of the Contours feature layer based on the Elevation feature attribute field, and print the count of modified features.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Modify the z-values of the features
var count = Esri.ArcGISForAutoCAD.FeatureLayer.ElevateToField(doc, "Contours", "Elevation");
// Print the number of features with modified z-values
doc.Editor.WriteMessage ("Number of modified features: " + count);
/* Example output
Number of modified features: 49
*/
Example 2
Modify the elevation of a selected set of features in the Spot_Elevation feature layer 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, and print the count of modified features.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var selectionSet = doc.Editor.GetSelection().Value;
// Modify the z-values of the selected features
var count = Esri.ArcGISForAutoCAD.FeatureLayer.ElevateToField(doc, "Spot_Elevation", "Elevation", null, 3.28084, selectionSet);
// Print the number of features with modified z-values
doc.Editor.WriteMessage("Number of modified features: " + count);
/* Example output
Number of modified features: 3
*/
See also
esri_featurelayer_elevatetofield—An AutoLISP function that modifies the z-coordinates of the entities of the specified feature layer and any TEXT entities linked to those features.