ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping.Voxel Namespace / VoxelVariableProfile Class / UpdateIsosurface Method
The definition of the isosurface to update
Example

In This Topic
    UpdateIsosurface Method
    In This Topic
    Update the specified isosurface. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void UpdateIsosurface( 
       IsosurfaceDefinition isosurfaceDef
    )
    Public Sub UpdateIsosurface( _
       ByVal isosurfaceDef As IsosurfaceDefinition _
    ) 

    Parameters

    isosurfaceDef
    The definition of the isosurface to update
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Invalid isosurface definition specified.
    Isosurface not found in the collection of surfaces
    Example
    How to Change Value and Color on an Isosurface
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    var variable = voxelLayer.SelectedVariableProfile;
    
    //Change the color of the first surface for the given profile
    var surface = variable.GetIsosurfaces().FirstOrDefault();
    if (surface != null)
    {
        if (voxelLayer.Visualization != VoxelVisualization.Surface)
            voxelLayer.SetVisualization(VoxelVisualization.Surface);
    
        //Change the iso surface voxel value
        surface.Value = surface.Value * 0.9;
    
        //get a random color
        var count = new Random().Next(0, 100);
        var colors = ColorFactory.Instance.GenerateColorsFromColorRamp(
            ((CIMVoxelStretchRenderer)variable.Renderer).ColorRamp, count);
    
        var idx = new Random().Next(0, count - 1);
        surface.Color = colors[idx];
        //set the custom color flag true to lock the color
        //locking the color prevents it from being changed if the
        //renderer color range or color theme is updated
        surface.IsCustomColor = true;
    
        //update the surface
        variable.UpdateIsosurface(surface);
    }
    
    Change Isourface Color Back to Default
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    //var variable = ...;
    //var surface = ...;
    
    if (surface.IsCustomColor)
    {
        surface.Color = variable.GetIsosurfaceColor((double)surface.Value);
        surface.IsCustomColor = false;
        //update the surface
        variable.UpdateIsosurface(surface);
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also