Public Sub DeleteSlice( _ ByVal sliceDef As SliceDefinition _ )
public void DeleteSlice( SliceDefinition sliceDef )
Parameters
- sliceDef
- The definition of the slice to delete.
Public Sub DeleteSlice( _ ByVal sliceDef As SliceDefinition _ )
public void DeleteSlice( SliceDefinition sliceDef )
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run |
| System.ArgumentException | Slice not found in the collection of slices |
| System.ArgumentNullException | Slice is null |
{
// Note: call within QueuedTask.Run()
{
//Use the SelectedVariableProfile to get the slices currently in the TOC
//via its associated volume
var volume = voxelLayer.SelectedVariableProfile.Volume;
var last_slice = volume.GetSlices().LastOrDefault();
if (last_slice != null)
volume.DeleteSlice(last_slice);
//Delete all slices
var slices = volume.GetSlices();
foreach (var slice in slices)
volume.DeleteSlice(slice);
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)