ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Layer Class / CanSetElevationTypeDefinition Method
Example

In This Topic
    CanSetElevationTypeDefinition Method
    In This Topic
    Gets whether the elevation type definition can be set on the layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function CanSetElevationTypeDefinition( _
       ByVal elevationTypeDefinition As ElevationTypeDefinition _
    ) As Boolean
    public bool CanSetElevationTypeDefinition( 
       ElevationTypeDefinition elevationTypeDefinition
    )

    Parameters

    elevationTypeDefinition

    Return Value

    A boolean indicating whether the elevation type definition is valid.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Set Elevation Mode for a layer
    {
        //Note: needs to be called on the MCT
        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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.3 or higher.
    See Also