ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Layer Class / SetElevationTypeDefinition Method
Example

In This Topic
    SetElevationTypeDefinition Method
    In This Topic
    Sets the elevation type definition for the layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void SetElevationTypeDefinition( 
       ElevationTypeDefinition elevationTypeDefinition
    )
    Public Sub SetElevationTypeDefinition( _
       ByVal elevationTypeDefinition As ElevationTypeDefinition _
    ) 

    Parameters

    elevationTypeDefinition
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Invalid definition configuration for this layer.
    Example
    Set Elevation Mode for a layer
    //Note: Use QueuedTask.Run
    ElevationTypeDefinition elevationTypeDefinition = featureLayer.GetElevationTypeDefinition();
    elevationTypeDefinition.ElevationType = LayerElevationType.OnGround;
    //elevationTypeDefinition.ElevationType = LayerElevationType.RelativeToGround;
    //elevationTypeDefinition.ElevationType = LayerElevationType.RelativeToScene;
    //elevationTypeDefinition.ElevationType = LayerElevationType.AtAbsoluteHeight;
    //..so on.
    //Optional: Specify the cartographic offset
    elevationTypeDefinition.CartographicOffset = 1000;
    //Optional: Specify the VerticalExaggeration
    elevationTypeDefinition.VerticalExaggeration = 2;
    if (featureLayer.CanSetElevationTypeDefinition(elevationTypeDefinition))
          featureLayer.SetElevationTypeDefinition(elevationTypeDefinition);
    Set Elevation Mode for a layer
    //Note: Use QueuedTask.Run
    ElevationTypeDefinition elevationTypeDefinition = featureLayer.GetElevationTypeDefinition();
    elevationTypeDefinition.ElevationType = LayerElevationType.OnGround;
    //elevationTypeDefinition.ElevationType = LayerElevationType.RelativeToGround;
    //elevationTypeDefinition.ElevationType = LayerElevationType.RelativeToScene;
    //elevationTypeDefinition.ElevationType = LayerElevationType.AtAbsoluteHeight;
    //..so on.
    //Optional: Specify the cartographic offset
    elevationTypeDefinition.CartographicOffset = 1000;
    //Optional: Specify the VerticalExaggeration
    elevationTypeDefinition.VerticalExaggeration = 2;
    if (featureLayer.CanSetElevationTypeDefinition(elevationTypeDefinition))
          featureLayer.SetElevationTypeDefinition(elevationTypeDefinition);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.3 or higher.
    See Also