ArcGIS Desktop

  • 文档
  • 支持

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS for Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

GetParameterAsText

  • 摘要
  • 说明
  • 语法
  • 代码示例

摘要

按照参数在参数列表中的索引位置以文本字符串的形式获取指定参数。

说明

无论参数的数据类型是什么,所有值都将作为字符串返回;要将参数用作 ArcPy 或 Python 对象,请参阅 GetParameter。

语法

GetParameterAsText (index)
参数说明数据类型
index

参数列表中参数的数值位置。

Integer

返回值

数据类型说明
String

以字符串形式返回的指定参数值。

代码示例

GetParameterAsText 示例

以文本字符串形式获取指定参数。

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)

相关主题

  • CopyParameter
  • GetArgumentCount
  • GetParameter
  • GetParameterCount
  • GetParameterInfo
  • GetParameterValue
  • SetParameter
  • SetParameterAsText
  • 设置脚本工具参数

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

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

关于 Esri

  • 关于我们
  • 招贤纳士
  • 内部人员博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2018 Esri. | 隐私政策 | 法律声明