Public Shared Function CreateHorizontalSectionDefinition() As SectionDefinition
public static SectionDefinition CreateHorizontalSectionDefinition()
Return Value
SectionDefinition where the section plane is horizontal
Public Shared Function CreateHorizontalSectionDefinition() As SectionDefinition
public static SectionDefinition CreateHorizontalSectionDefinition()
{
// Note: call within 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
//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);
volume.CreateSection(horz_section);
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)