ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

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

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

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

ArcGIS Solutions

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

ArcGIS Marketplace

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

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

ArcMap

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

Value

  • 描述
  • 属性
  • 代码示例

描述

Value 对象将从 GetParameterInfo(用于脚本工具的 ToolValidator 类时)和 GetParameter 函数返回,具体取决于参数类型。

属性

属性说明数据类型
isEmpty
(只读)

指示值对象是否为空。

注:

如果参数没有值,则参数的 value 属性将返回 NoneType 且 isEmpty 属性将无法访问。要确定某个参数是否具有值,请使用 if 语句检查 Parameter 的 value 属性,例如 if param.value:。

Boolean
value
(可读写)

提供值对象的值。

String

代码示例

值示例

UpdateParameter 将根据 NetCDF 文件的属性名称填充第二个参数的值列表。

def updateParameters(self):
    """Modify the values and properties of parameters before internal
    validation is performed.  This method is called whenever a parameter
    has been changed."""
    # If the parameter has been altered, but not validated
    if self.params[0].altered and not self.params[0].hasBeenValidated:
        # Create a NetCDFFIleProperties object based on the input and
        #   use it to populate the value list of the sceond parameter.
        net_cdf = arcpy.NetCDFFileProperties(self.params[0].value.value)
        att_names = net_cdf.getAttributeNames()
        self.params[1].filter.list = att_names
        self.params[1].value = att_names[0]
    return

相关主题

  • 设置脚本工具参数
  • Filter
  • Parameter
  • Schema
  • 自定义脚本工具行为

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

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