ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Mapping.Voxel Namespace / SectionDefinition Class / CreateHorizontalSectionDefinition Method
Example

In This Topic
    CreateHorizontalSectionDefinition Method
    In This Topic
    Factory method for creating a horizontal section
    Syntax
    public static SectionDefinition CreateHorizontalSectionDefinition()
    Public Shared Function CreateHorizontalSectionDefinition() As SectionDefinition

    Return Value

    SectionDefinition where the section plane is horizontal
    Example
    Create a Horizontal Section
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    if (voxelLayer.Visualization != VoxelVisualization.Surface)
        voxelLayer.SetVisualization(VoxelVisualization.Surface);
    voxelLayer.SetSectionContainerExpanded(true);
    voxelLayer.SetSectionContainerVisibility(true);
    
    //Create a section that cuts the volume in two on the horizontal plane
                
    //At 2.x - var volumeSize = voxelLayer.GetVolumeSize();
    
    //Use the SelectedVariableProfile to get the sections
    //via its associated volume
    var volume = voxelLayer.SelectedVariableProfile.Volume;
    var volumeSize = volume.GetVolumeSize();
    
    //Or use normal (0, 0, 1) or (0, 0, -1)...
    var horz_section = SectionDefinition.CreateHorizontalSectionDefinition();
    
    horz_section.Name = "Horizontal Section";
    horz_section.IsVisible = true;
    horz_section.VoxelPosition = new Coordinate3D(volumeSize.X / 2, volumeSize.Y / 2, volumeSize.Z / 2);
    
    //At 2.x - voxelLayer.CreateSection(horz_section);
    volume.CreateSection(horz_section);
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also