ArcGIS Desktop

  • Documentation
  • Support

  • 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

GetParameterAsText

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

Résumé

Gets the specified parameter as a text string by its index position from the list of parameters.

Discussion

Any value regardless of the parameter data type will be returned as a string; to use the parameter as an ArcPy or Python object instead, see GetParameter.

Syntaxe

GetParameterAsText (index)
ParamètreExplicationType de données
index

The numeric position of the parameter in the parameter list.

Integer

Valeur renvoyée

Type de donnéesExplication
String

The value of the specified parameter, returned as a string.

Exemple de code

GetParameterAsText example

Get specified parameter as text string.

import os
import arcpy

# Set the input workspace, get the feature class name to copy
#  and the output location.
arcpy.env.workspace = arcpy.GetParameterAsText(0)
in_featureclass = arcpy.GetParameterAsText(1)
out_workspace = arcpy.GetParameterAsText(2)

out_featureclass = os.path.join(out_workspace,
                                os.path.basename(in_featureclass))

# Copy feature class to output location
arcpy.CopyFeatures_management(in_featureclass, out_featureclass)

Rubriques connexes

  • CopyParameter
  • GetArgumentCount
  • GetParameter
  • GetParameterCount
  • GetParameterInfo
  • GetParameterValue
  • SetParameter
  • SetParameterAsText
  • Définition des paramètres des outils de script

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 des initiés
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
Donnez-nous votre avis.
Copyright © 2018 Esri. | Confidentialité | Légal