Summary
Deletes all the features associated with one or more selected grid and graticule layers from a feature dataset.
Usage
You can select all the grid and graticule layers for deletion or specify only the ones you want deleted from the Grid Name list.
You can unselect all previously selected grid and graticule layers to prevent deletion of any grid and graticule layers or unselect only specific ones not to delete.
A grid dataset that has been renamed cannot be used as an input dataset to this tool because the suffix of the grid feature classes will no longer match the name of the grid.
Syntax
arcpy.cartography.DeleteGridsAndGraticules(in_grid_dataset, grid_name)
Parameter | Explanation | Data Type |
in_grid_dataset | The feature dataset location where the grid and graticule layers that can be deleted are stored. | Feature Dataset |
grid_name [grid_name,...] | Lists the grid and graticule layers in the feature dataset that can be deleted. | String |
Code sample
DeleteGridsAndGraticules tool Example (Python Window)
Deletes grid and graticule layers from a feature dataset.
import arcpy
from arcpy import env
env.workspace = "C:/Python_Output"
arcpy.DeleteGridsAndGraticules_cartography("C:/Python_Output/grid_layers.gdb/QUAD_24K",
"Plaza Washington (Quad_24K_NAD83)")
DeleteGridsAndGraticules tool Example (Stand-alone Python script)
Deletes grid and graticule layers from a feature dataset.
# Name: DeleteGridsAndGraticules.py
# Description: Delete grid(s) from a feature dataset.
# Author: ESRI
# Import system module
import arcpy
# Enabling logging of the results
arcpy.logHistory = True
# Set the values of the tool's parameters
input_grid_dataset = "C:/Python_Output/grid_layers.gdb/QUAD_24K"
grid_name = ['Plaza Washington (Quad_24K_NAD83)','Swift Minnesota (Quad_24K_NAD83)']
# Process: Delete Grids and Graticules
arcpy.DeleteGridsAndGraticules_cartography(input_grid_dataset, grid_name)
print "Grids and Graticules features deletion successful"
Environments
This tool does not use any geoprocessing environments.
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes