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

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • エクステンション

GetParameterInfo

  • 概要
  • 構文
  • コードのサンプル

概要

Returns a list of parameter objects for a given tool and is commonly used in a script tool's ToolValidator class.

構文

GetParameterInfo (tool_name)
パラメーター説明データ タイプ
tool_name

The tool name. Including the toolbox alias will help to resolve any conflicts with duplicate tool names.

メモ:

When the GetParameterInfo function is used as part of a script tool's ToolValidator class, the tool_name argument is optional.

String

戻り値

データ タイプ説明
Parameter

Returns a list of parameter objects.

コードのサンプル

GetParameterInfo example 1

Display some parameter object properties for the specified tool.

import arcpy

# Load tool parameter objects into list.
params = arcpy.GetParameterInfo("HotSpots")

for param in params:
    print("Name: {}, Type: {}, Value: {}".format(
        param.name, param.parameterType, param.value))
GetParameterInfo example 2

Setting symbology for a script tool's output dataset.

import os
import arcpy

# Set data variables for Clip tool.
in_features = arcpy.GetParameterAsText(0)
clip_features = arcpy.GetParameterAsText(1)
out_feature_class = arcpy.GetParameterAsText(2)

# Execute Clip tool
output = arcpy.Clip_analysis(in_features, clip_features,
                             out_feature_class)[0]

# Get parameter objects
params = arcpy.GetParameterInfo()

# Use describe on result object and get shape type.
desc = arcpy.Describe(output)

# Set symbology property for out_feature_class parameter
# Layer files are located in same folder as the .py file
lyr_location = os.path.dirname(__file__)

if desc.shapeType == "Polygon":
    params[2].symbology = os.path.join(lyr_location, "Polygon.lyr")
elif desc.shapeType == "Polyline":
    params[2].symbology = os.path.join(lyr_location, "Polyline.lyr")
else:
    params[2].symbology = os.path.join(lyr_location, "Point.lyr")

関連トピック

  • CopyParameter
  • GetArgumentCount
  • GetParameter
  • GetParameterAsText
  • GetParameterCount
  • GetParameterValue
  • SetParameter
  • SetParameterAsText
  • スクリプト ツール パラメーターの設定

ArcGIS Desktop

  • ホーム
  • ドキュメント
  • サポート

ArcGIS

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

Esri について

  • 会社概要
  • 採用情報
  • Esri ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
ご意見・ご感想をお寄せください。
Copyright © 2021 Esri. | プライバシー | リーガル