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
  • マイ プロフィール
  • サイン アウト

ArcMap

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

アタッチメントの有効化 (Enable Attachments)

  • サマリー
  • 使用法
  • 構文
  • コードのサンプル
  • 環境
  • ライセンス情報

サマリー

ジオデータベース フィーチャクラスまたはテーブルでアタッチメントを有効化します。必要なアタッチメント リレーションシップ クラスと、アタッチメント ファイルを内部的に格納するアタッチメント テーブルを作成します。

  • ジオデータベース アタッチメントの詳細
  • アタッチメントに関するジオプロセシング ツールの操作の詳細

使用法

  • [アタッチメントの追加 (Add Attachments)] ツールを使用してアタッチメントを追加する前に、このツールを使用してアタッチメントを有効化する必要があります。

  • ジオデータベース フィーチャクラスまたはテーブルでアタッチメントがすでに有効化されている場合は、警告メッセージが表示され、処理は実行されません。

構文

EnableAttachments_management (in_dataset)
パラメーター説明データ タイプ
in_dataset

アタッチメントを有効化するジオデータベース テーブルまたはフィーチャクラス。入力は、バージョン 10 以降のジオデータベースに存在している必要があります。

Table View

派生した出力

名前説明データ タイプ
out_dataset

コードのサンプル

EnableAttachments (アタッチメントの有効化) の例 (Python ウィンドウ)

次のコード スニペットは、Python ウィンドウで EnableAttachments (アタッチメントの有効化) ツールを使用する方法を示しています。

import arcpy
arcpy.EnableAttachments_management(r"C:\Data\City.gdb\Parcels")
EnableAttachments (アタッチメントの有効化) の例 (スタンドアロン Python スクリプト)

次のスクリプトは、スタンドアロン スクリプトで EnableAttachments (アタッチメントの有効化) ツールを使用する方法を示しています。

"""
Example: we have a folder of digital photographs of vacant homes; the photos
are named according to the ParcelID of the house in the picture. Let's add
these photos to a parcel feature class as attachments.
"""
import csv
import arcpy
import os
import sys
input = r"C:\Data\City.gdb\Parcels"
inputField = "ParcelID"
matchTable = r"C:\Data\matchtable.csv"
matchField = "ParcelID"
pathField = "Picture" 
picFolder = r"C:\Pictures"
try:
    # create a new Match Table csv file
    writer = csv.writer(open(matchTable, "wb"), delimiter=",")
    # write a header row (the table will have two columns: ParcelID and Picture)
    writer.writerow([matchField, pathField])
    # iterate through each picture in the directory and write a row to the table
    for file in os.listdir(picFolder):
        if str(file).find(".jpg") > -1:
            writer.writerow([str(file).replace(".jpg", ""), file])
    del writer
    # the input feature class must first be GDB attachments enabled
    arcpy.EnableAttachments_management(input)
    # use the match table with the Add Attachments tool
    arcpy.AddAttachments_management(input, targetField, matchTable, matchField, pathField, picFolder)
except Exception as err:
    print(err.args[0])

環境

  • 現在のワークスペース

ライセンス情報

  • ArcGIS Desktop Basic: いいえ
  • ArcGIS Desktop Standard: はい
  • ArcGIS Desktop Advanced: はい

関連トピック

  • アタッチメント ツールセットの概要
  • アタッチメント ジオプロセシング ツールの操作

ArcGIS Desktop

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

ArcGIS プラットフォーム

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

Esri について

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