ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS for Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

Help

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • その他...

GetSeverityLevel

  • サマリー
  • 構文
  • コードのサンプル

サマリー

Returns the severity level. The severity level is used to control how geoprocessing tools throw exceptions.

構文

GetSeverityLevel ()

戻り値

データ タイプ説明
Integer

The severity level.

  • 0 —A tool will not throw an exception, even if the tool produces an error or warning.
  • 1 —If a tool produces a warning or an error, it will throw an exception.
  • 2 —If a tool produces an error, it will throw an exception. This is the default.

コードのサンプル

GetSeverityLevel example

Use SetSeverityLevel to force tool to throw an exception when a tool warning is encountered.

import arcpy

fc_1 = 'c:/resources/resources.gdb/boundary'
fc_2 = 'c:/resources/resources.gdb/boundary2'

# Set the severity level to 1 (tool warnings will throw an exception)
arcpy.SetSeverityLevel(1)
print("Severity is set to : {0}".format(arcpy.GetSeverityLevel()))

try:
    # FeatureCompare returns warning messages when a miscompare is
    #  found.  This normally would not cause an exception, however, by
    #  setting the severity level to 1, all tool warnings will also
    #  return an exception.
    arcpy.FeatureCompare_management(fc_1, fc_2, "OBJECTID")

except arcpy.ExecuteWarning:
    print(arcpy.GetMessages(1))
except arcpy.ExecuteError:
    print(arcpy.GetMessages(2))

関連トピック

  • SetSeverityLevel

ArcGIS Desktop

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

ArcGIS プラットフォーム

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

Esri について

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