ArcGIS for Desktop

  • Documentation
  • Tarification
  • Support

  • My Profile
  • Aide
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

La plateforme cartographique de votre organisation

ArcGIS for Desktop

Un SIG professionnel complet

ArcGIS for Server

SIG dans votre entreprise

ArcGIS for Developers

Outils de création d'applications de localisation

ArcGIS Solutions

Modèles d'applications et de cartes gratuits pour votre secteur d'activité

ArcGIS Marketplace

Téléchargez des applications et des données pour votre organisation.

  • Documentation
  • Tarification
  • Support
Esri
  • Se connecter
user
  • Mon profil
  • Déconnexion

Help

  • Accueil
  • Commencer
  • Carte
  • Analyser
  • Gérer les données
  • Outils
  • Plus...

ListTableViews

  • Récapitulatif
  • Discussion
  • Syntaxe
  • Exemple de code

Récapitulatif

Returns a Python list of TableView objects that exist within a map document (.mxd).

Discussion

ListTableViews always returns a list object even if only one table is returned. In order to return a TableView object, an index value must be used on the list (e.g., aTable = arcpy.mapping.ListTableViews(mxd)[0]). For loops on a list provide an easy mechanism to iterate through each item in the list (e.g., for aTable in arcpy.mapping.ListTableViews(mxd):).

Wildcards are used on the name property and are not case sensitive. A wildcard string of "so*" will return a layer with a name Soils. Wildcards can be skipped in the scripting syntax simply by passing an empty string (""), an asterisk (*), or entering wildcard=None, or nothing at all if it is the last optional parameter in the syntax.

It is possible that there might be tables in a map document that have the same name. If that is the case, then other properties may need to be used to isolate a specific layer. Properties such as a tables's datasource or definitionQuery could be used to do this. It is ideal that all tables in a map document be uniquely named.

Syntaxe

ListTableViews (map_document, {wildcard}, {data_frame})
ParamètreExplicationType de données
map_document

A variable that references a MapDocument object.

MapDocument
wildcard

A combination of asterisks (*) and characters can be used to help limit the results.

(La valeur par défaut est None)

String
data_frame

A variable that references a DataFrame object.

(La valeur par défaut est None)

DataFrame

Valeur renvoyée

Type de donnéesExplication
TableView

A Python list of TableView objects.

Exemple de code

ListTableViews example

The following script finds a table called TrafficAccidents in a data frame named Transportation and sets a definition query.

import arcpy
mxd = arcpy.mapping.MapDocument(r"c:\project\project.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Transportation")[0]
table = arcpy.mapping.ListTableViews(mxd, "TrafficAccidents", df)[0]
table.definitionQuery = "[Accidents] > 5"
mxd.save()
del mxd
Vous avez un commentaire à formuler concernant cette rubrique ?

ArcGIS for Desktop

  • Accueil
  • Documentation
  • Tarification
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

A propos d'Esri

  • A propos de la société
  • Carrières
  • Blog des initiés
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Confidentialité | Légal