Label | Explanation | Data Type |
Input Network Analysis Layers
| The network analysis layer or layers to delete. | Network Analyst Layer |
Derived Output
Label | Explanation | Data Type |
Delete Succeeded | Indicates whether the deletion succeeded. | Boolean |
Deletes a network analysis layer and its analysis data.
The tool deletes the input network analysis layer's analysis data (the feature classes and tables referenced by the network analysis layer's sublayers and subtables). The layer's network data source is not deleted.
This tool is useful in a model in which a network analysis layer is created as an intermediate step. If such a model is run repeatedly, unwanted sublayer data may accumulate in the project geodatabase. This tool can be used to clean up the network analysis layer's analysis data in the model workflow.
If the network analysis layer is in a map, the layer will be removed from the map.
Label | Explanation | Data Type |
Input Network Analysis Layers
| The network analysis layer or layers to delete. | Network Analyst Layer |
Label | Explanation | Data Type |
Delete Succeeded | Indicates whether the deletion succeeded. | Boolean |
arcpy.na.DeleteNetworkAnalysisLayer(in_network_analysis_layers)
Name | Explanation | Data Type |
in_network_analysis_layers [in_network_analysis_layers,...] | The network analysis layer or layers to delete. | Network Analyst Layer |
Name | Explanation | Data Type |
delete_succeeded | Indicates whether the deletion succeeded. | Boolean |
In this code snippet, the DeleteNetworkAnalysisLayer function is used to delete a Vehicle Routing Problem layer and its analysis data after completing a workflow.
import arcpy
layer = arcpy.na.MakeVehicleRoutingProblemAnalysisLayer(network, "VRP").getOutput(0)
# Additional workflow steps
arcpy.na.DeleteNetworkAnalysisLayer(layer)