ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Aide
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plateforme cartographique de votre organisation

ArcGIS Desktop

Un SIG professionnel complet

ArcGIS Enterprise

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
  • Support
Esri
  • Se connecter
user
  • Mon profil
  • Déconnexion

ArcMap

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

RefreshTOC

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

Résumé

Refreshes the table of contents.

Discussion

If Python is used to modify the table of contents within the current map document (e.g., change a layer name), the map will not automatically update with the changes. RefreshTOC is only needed if you want to see the table of contents updated.

Syntaxe

RefreshTOC ()

Exemple de code

RefreshTOC example

A simple script run from the Python window that demonstrates how to update the Table of Contents and force a refresh to make the change visible.

import arcpy

# Create a MapDocument object from the current map
mxd = arcpy.mapping.MapDocument("CURRENT")

# Update the layer name of the first layer in the Table of Contents
arcpy.mapping.ListLayers(mxd)[0].name = "New Layer Name"

# Refresh the Table of Contents to reflect the change
arcpy.RefreshTOC()

del mxd

ArcGIS Desktop

  • Accueil
  • Documentation
  • Support

ArcGIS Platform

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

A propos d'Esri

  • A propos de la société
  • Carrières
  • Blog d’Esri
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
Donnez-nous votre avis.
Copyright © 2019 Esri. | Confidentialité | Légal