RemoveTableView (arcpy.mapping)

サマリ

Provides the ability to remove a table within a data frame in a map document (.mxd).

説明

RemoveTableView will remove a single table from a specific data frame in a map document.

構文

RemoveTableView (data_frame, remove_table)
パラメータ説明データ タイプ
data_frame

A reference to a DataFrame object that contains the layer to be removed.

DataFrame
remove_table

A reference to a Layer object representing the layer to be removed.

TableView

コードのサンプル

RemoveTableView example

The following script will remove all tables with the name Accidents from a map document.

import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
for df in arcpy.mapping.ListDataFrames(mxd):
    for tbl in arcpy.mapping.ListTableViews(mxd, "", df):
        if tbl.name.lower() == "accidents":
            arcpy.mapping.RemoveTableView(df, tbl)
mxd.saveACopy(r"C:\Project\Project2.mxd")
del mxd
9/14/2013