Table
サマリー
Enables you to reference a table either using a workspace path or a URL so that it can be added to a Map.
ディスカッション
For a more complete discussion, refer to the Table Class help.
構文
Table(table_data_source)
| パラメーター | 説明 | データ タイプ |
|---|---|---|
|
table_data_source |
A string that includes the full workspace path or URL, including the name of the table. For SDE tables, the workspace path is the path to an SDE connection file. |
String |
戻り値
| データ タイプ | 説明 |
|---|---|
|
Table |
The |
コードのサンプル
Table example 1
The following script will print the stand-alone table names that have a broken data source for all tables in all maps.
import arcpy
aprx = arcpy.mp.ArcGISProject(r"C:\Projects\YosemiteNP\Yosemite.aprx")
for m in aprx.listMaps():
for tbl in m.listTables():
if tbl.isBroken:
print(f"Table: {tbl.name} is broken in map: {m.name}")
del aprx
Table example 2
The following script will add a table from a file geodatabase into a map.
import arcpy
aprx = arcpy.mp.ArcGISProject(r"C:\Projects\YosemiteNP\Yosemite.aprx")
addTab = arcpy.mp.Table(r"C:\Projects\YosemiteNP\Data_Vector\YosemiteData.gdb\NHDFCode")
m = aprx.listMaps("Yose*")[0]
m.addTable(addTab)
del aprx