ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / VoxelLayer Class / GetVariableProfiles Method
Example

In This Topic
    GetVariableProfiles Method (VoxelLayer)
    In This Topic
    Gets the collection of variable profiles.
    Syntax
    public IList<VoxelVariableProfile> GetVariableProfiles()
    Public Function GetVariableProfiles() As IList(Of VoxelVariableProfile)
    Example
    Change the Selected Variable Profile
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    var profiles = voxelLayer.GetVariableProfiles();
    
    //Select any profile as long as it is not the current selected variable
    var not_selected = profiles.Where(p => p.Variable != sel_profile.Variable).ToList();
    if (not_selected.Count() > 0)
    {
        voxelLayer.SetSelectedVariableProfile(not_selected.First());
    }
    
    Get the Variable Profiles
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    var variable_profiles = voxelLayer.GetVariableProfiles();
    
    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
    }
    
    Check the MaxNumberofIsoSurfaces for a Variable
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    var variable = voxelLayer.GetVariableProfiles().First();
    var max = variable.MaxNumberOfIsosurfaces;
    if (max >= variable.GetIsosurfaces().Count)
    {
        //no more surfaces can be created on this variable
    }
    
    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