ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping.Voxel Namespace / VoxelVariableProfile Class / DataType Property
Example

In This Topic
    DataType Property (VoxelVariableProfile)
    In This Topic
    Gets the variable profile's data type. Data can be continuous or discrete.
    Syntax
    public VoxelVariableDataType DataType {get;}
    Public ReadOnly Property DataType As VoxelVariableDataType
    Example
    Get the Variable Renderer
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    var variable = voxelLayer.GetVariableProfiles().First();
    var renderer = variable.Renderer;
    if (variable.DataType == VoxelVariableDataType.Continuous)
    {
        //Renderer will be stretch
        var stretchRenderer = renderer as CIMVoxelStretchRenderer;
        //access the renderer
    
    }
    else //VoxelVariableDataType.Discrete
    {
        //Renderer will be unique value
        var uvr = renderer as CIMVoxelUniqueValueRenderer;
        //access the renderer
    }
    
    Access Stats and Color Range for a Stretch Renderer
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    //Get the variable profile on which to access the data
    var variable = voxelLayer.SelectedVariableProfile;
    //or use ...voxelLayer.GetVariableProfiles()
    
    //Data range
    //At 2.x - 
    //var min = variable.GetVariableStatistics().MinimumValue;
    //var max = variable.GetVariableStatistics().MaximumValue;
    
    var min = variable.Statistics.MinimumValue;
    var max = variable.Statistics.MaximumValue;
    
    //Color range (Continuous only)
    double color_min, color_max;
    if (variable.DataType == VoxelVariableDataType.Continuous)
    {
        var renderer = variable.Renderer as CIMVoxelStretchRenderer;
        color_min = renderer.ColorRangeMin;
        color_max = renderer.ColorRangeMax;
    }
    
    Check a Variable's Datatype
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    var variable = voxelLayer.GetVariableProfiles().First();
    if (variable.DataType != VoxelVariableDataType.Continuous)
    {
        //No iso surfaces
        //Iso surface can only be created for VoxelVariableDataType.Continuous
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also