public void DeleteSlice( SliceDefinition sliceDef )
Public Sub DeleteSlice( _ ByVal sliceDef As SliceDefinition _ )
Parameters
- sliceDef
- The definition of the slice to delete.
public void DeleteSlice( SliceDefinition sliceDef )
Public Sub DeleteSlice( _ ByVal sliceDef As SliceDefinition _ )
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 |
//var voxelLayer = ... ; //Must be on the QueuedTask.Run() //At 2.x //var last_slice = voxelLayer.GetSlices().LastOrDefault(); // if (last_slice != null) // voxelLayer.DeleteSlice(last_slice); // //Delete all slices // var slices = voxelLayer.GetSlices(); // foreach (var slice in slices) // voxelLayer.DeleteSlice(slice); //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, Windows 10