ArcGIS for Desktop

  • ドキュメント
  • 価格
  • サポート

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

ArcGIS Online

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

ArcGIS for Desktop

完全なプロ仕様の GIS

ArcGIS for Server

エンタープライズ GIS

ArcGIS for Developers

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

ArcGIS Solutions

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

ArcGIS Marketplace

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

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

ヘルプ

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

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

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

サマリ

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

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

使用法

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

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

構文

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

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

Table View

コードのサンプル

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 for Desktop Basic: ×
  • ArcGIS for Desktop Standard: ○
  • ArcGIS for Desktop Advanced: ○

関連トピック

  • アタッチメント ツールセットの概要
  • アタッチメント ジオプロセシング ツールの操作
このトピックへのフィードバック

ArcGIS for Desktop

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

ArcGIS プラットフォーム

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

Esri について

  • 会社概要
  • 採用情報
  • スタッフ ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | プライバシー | リーガル