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

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

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

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

概要

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

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

使用法

  • 入力データセットをエンタープライズ データセットから取得する場合、データの所有者として確立されたデータベース接続から取得する必要があります。

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

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

構文

arcpy.management.EnableAttachments(in_dataset)
パラメーター説明データ タイプ
in_dataset

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

Table View

派生した出力

名前説明データ タイプ
out_dataset

更新された入力データセット。

テーブル ビュー

コードのサンプル

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

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

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

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

"""
Example: You have a folder of digital photographs of vacant homes; the photos
are named according to the ParcelID of the house in the picture. You'll add
these photos to a parcel feature class as attachments.
"""
import csv
import arcpy
import os
input = r"C:\Data\City.gdb\Parcels"
inputField = "ParcelID"
matchTable = r"C:\Data\matchtable.csv"
matchField = "ParcelID"
pathField = "Picture" 
picFolder = r"C:\Pictures"
# 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, inputField, matchTable, matchField, 
                                pathField, picFolder)

環境

  • 現在のワークスペース

ライセンス情報

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

関連トピック

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

ArcGIS Desktop

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

ArcGIS

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

Esri について

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