概要
スケマティック ダイアグラムを更新します。
関連するスケマティック ビルダーに応じて、フィーチャ レイヤー、フィーチャクラス、オブジェクト テーブル、解析済みのネットワーク解析、または XML データからダイアグラムを更新できます。
使用法
- [入力データ] パラメーターの指定は、ネットワーク データセット ビルダーおよび XML ビルダーと連動するダイアグラムでは必須です。ジオメトリック ネットワークまたはネットワーク データセットから動作するように構成されたスタンダード ビルダーと連動するダイアグラムではオプションです。カスタム クエリから動作するように構成されたスタンダード ビルダーと連動するダイアグラムでは、このパラメーターは指定しません。 
- スタンダード ビルダーによって実装された、ジオメトリック ネットワーク トレースから生成されたダイアグラムに対して [ダイアグラムの更新 (Update Diagram)] ツールを使用した場合、ハイライトされたトレースからそのダイアグラムが最初に生成されたときに、スケマティック データセットに保存されたトレース パラメーターに基づく更新トレース結果から更新が実行されます。 
- ジオメトリック ネットワークまたはネットワーク データセットを構成するフィーチャから更新を実行する必要がある場合、[入力データ] パラメーターにすべてのフィーチャ レイヤーを指定する必要はありません。スタンダード ビルダーのプロパティで [接続ノードの追加] オプションを指定した場合、エッジ フィーチャまたはエッジ ネットワーク エレメントに関連するフィーチャ レイヤーのみ指定可能ですが、更新にはそのジオメトリック ネットワークまたはネットワーク データセットに関連するすべてのフィーチャ レイヤー (ジャンクションおよびエッジ) が使用されます。 
- 指定したスケマティック ダイアグラムに対して特定のレイアウトが保存されている場合、更新前にそのダイアグラム内に存在したスケマティック フィーチャが、最後に保存された位置に基づいて表示されます。更新時に新しいスケマティック フィーチャが導入された場合、そのフィーチャが対応する地理座標に配置されます。 
構文
arcpy.schematics.UpdateDiagram(in_diagram, {in_data}, {builder_options})| パラメーター | 説明 | データ タイプ | 
| in_diagram | 更新するスケマティック ダイアグラム レイヤー。 | Schematic Layer | 
| in_data [in_data,...] (オプション) | ダイアグラム更新のベースとなる入力データ。 [入力データ] パラメーターの指定は、定義済みのすべてのビルダーで必須ではありません。これはオプション パラメーターです。 
 | Table View;Data Element;Layer | 
| builder_options (オプション) | スケマティック ビルダーの更新オプション。更新オプションはオプションです。指定したスケマティック ダイアグラムを実装するダイアグラム テンプレートに関連付けられているビルダーによって異なります。 
 
 | String | 
コードのサンプル
UpdateDiagram (ダイアグラムの更新) とカスタム クエリから動作するスタンダード ビルダー - 例 1 (スタンドアロン Python スクリプト)
全体がカスタム クエリから構築されたサンプルのスケマティック ダイアグラムを更新します。この場合、ダイアグラム名パラメーターのみが必須です。この Python スクリプトの例の実行方法は次のとおりです。
- 新しい空のマップを使用して ArcCatalog または ArcMap を起動します。
- 以下のスクリプトをコピーして Python ウィンドウに貼り付けます。
- Enter キーを押します。
# Name: UpdateDiagramCustomQuery.py
# Description: Update a schematic diagram entirely built from custom queries
# Requirement: ArcGIS Schematics extension
# import system modules
import arcpy
msgNoLicenseAvailable = "ArcGIS Schematics extension license required"
try:
    # Checks out the ArcGIS Schematics extension license
    if arcpy.CheckExtension("Schematics") == "Available":
        arcpy.CheckOutExtension("Schematics")
    else:
        raise Exception(msgNoLicenseAvailable)
    # Sets Schematics general settings
    dataLocation="C:/ArcGIS/ArcTutor/Schematics/Schematics_In_ArcMap"
    gdbName="ElecDemo.gdb"
    in_schDataset="ElecDemo"
    in_schFolder="Inside Plants"
    in_diagName="Substation 08"
    builder_option1="REFRESH"
    # Sets environment settings
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = dataLocation + "/" + gdbName
    # UpdateDiagram by only refreshing attributes on the input diagram's schematic features 
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_schFolder + "/" + in_diagName, "#", builder_option1)
    # UpdateDiagram by fully synchronizing the input custom queries-based diagram (no parameters required)
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_schFolder + "/" + in_diagName)
    # Returns the ArcGIS Schematics extension license
    arcpy.CheckInExtension("Schematics")
    print "Script completed successfully"
except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occurred on line %i" % tb.tb_lineno
    print str(e)
UpdateDiagram (ダイアグラムの更新) とジオメトリック ネットワーク データで動作するスタンダード ビルダー - 例 2 (スタンドアロン Python スクリプト)
ジオメトリック ネットワークにまとめられたフィーチャから構築されたサンプルのスケマティック ダイアグラムを更新します。この Python スクリプトの例の実行方法は次のとおりです。
- 新しい空のマップを使用して ArcCatalog または ArcMap を起動します。
- 以下のスクリプトをコピーして Python ウィンドウに貼り付けます。
- Enter キーを押します。
# Name: UpdateDiagramStd.py
# Description: Update schematic diagrams built from features organized into a geometric network
# Requirement: ArcGIS Schematics extension
# import system modules
import arcpy
msgNoLicenseAvailable = "ArcGIS Schematics extension license required"
try:
    # Checks out the ArcGIS Schematics extension license
    if arcpy.CheckExtension("Schematics") == "Available":
        arcpy.CheckOutExtension("Schematics")
    else:
        raise Exception(msgNoLicenseAvailable)
    # Sets Schematics general settings
    dataLocation="C:/ArcGIS/ArcTutor/Schematics/Schematics_In_ArcMap"
    gdbName="ElecDemo.gdb"
    in_schDataset="ElecDemo"
    in_schFolder="Feeders"
    in_diagTempName="GeoSchematic"
    # Sets variables used for the A/ UpdateDiagram sample
    in_diagAName="Feeder 0801-Rice Creek"
    # Sets variables used for the B/ UpdateDiagram sample
    in_diagBName="Feeder 0802-Goldmine"
    # Sets variables used for the C/ UpdateDiagram sample
    in_diagCName="WholeElectricNetworkDiagram"
    input_ForCDiag="ElectricNetwork/PrimaryLine;ElectricNetwork/SecondaryLine"    
    input_FC1="ElectricNetwork/PrimaryLine"
    # Sets variables used for the D/ UpdateDiagram sample
    in_diagDName="FeederDiagram"
    input_ForDDiag="ElectricNetwork/Feeder"
    input_FC2="ElectricNetwork/Substation"
    # Sets variables used for the E/ UpdateDiagram sample
    in_diagEName="FeederDiagramBIS"
    input_ForEDiag="ElectricNetwork/Feeder"
    input_FC3="ElectricNetwork/ServiceLocation"
    # Sets variables used for the F/ UpdateDiagram sample
    input_LayerName="PrimaryLineLayer"
    input_Filter="PHASECODE=135"    
    in_diagFName="PrimaryLinesDiagram"
    # Sets  builder_options variables for diagram Update
    # - For simply refreshing the diagram's attributes only
    U_option1="REFRESH"
    # - For rebuilding the diagram from a different input
    U_option2="REBUILD;KEEP_MANUAL_MODIF"
    U_option2BIS="REBUILD;NO_KEEP_MANUAL_MODIF"
    # - For appending new features to the diagram with a partial synchronization of its content
    U_option3="APPEND_QUICK;KEEP_MANUAL_MODIF"
    U_option3BIS="APPEND_QUICK;NO_KEEP_MANUAL_MODIF"
    # - For appending new features to the diagram with a full synchronization of its content
    U_option4="APPEND;KEEP_MANUAL_MODIF"
    U_option4BIS="APPEND;NO_KEEP_MANUAL_MODIF"
    # Sets environment settings
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = dataLocation + "/" + gdbName
    # Creates some new diagrams that will be used to exemplify the C/, D/, E/ and F/ UpdateDiagram samples
    arcpy.CreateDiagram_schematics(in_schDataset, in_diagCName, in_diagTempName, input_ForCDiag)
    arcpy.CreateDiagram_schematics(in_schDataset, in_diagDName, in_diagTempName, input_ForDDiag)
    arcpy.CreateDiagram_schematics(in_schDataset, in_diagEName, in_diagTempName, input_ForEDiag)
    InputLayer = arcpy.MakeFeatureLayer_management(input_FC1, input_LayerName, input_Filter)
    arcpy.CreateDiagram_schematics(in_schDataset, in_diagFName, in_diagTempName, InputLayer)
    # A/ UpdateDiagram by fully synchronizing the diagram content; no udpate parameters required
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_schFolder + "/" + in_diagAName)
    # B/ UpdateDiagram by only refreshing attributes on the input diagram's schematic features
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_schFolder + "/" + in_diagBName, "#", U_option1)
    # C/ UpdateDiagram by rebuilding the input diagram from a feature class
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_diagCName, input_FC1, U_option2)
    # D/ UpdateDiagram by appending new features to the input diagram with a partial synchronization
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_diagDName, input_FC2, U_option3)
    # E/ UpdateDiagram by appending new features to the input diagram with a full synchronization
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_diagEName, input_FC3, U_option4)
    # F/ UpdateDiagram by rebuilding the input diagram from an input layer
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_diagFName, InputLayer, U_option2)
    # Returns the ArcGIS Schematics extension license
    arcpy.CheckInExtension("Schematics")
    print "Script completed successfully"
except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occurred on line %i" % tb.tb_lineno
    print str(e)
UpdateDiagram (ダイアグラムの更新) と XML ビルダー - 例 3 (スタンドアロン Python スクリプト)
XML ビルダーに基づくサンプルのスケマティック ダイアグラムを更新します。この Python スクリプトの例の実行方法は次のとおりです。
- ArcCatalog を起動します。
- サンプル スクリプトで使用するスケマティック データセットを作成して構成します。- カタログ ツリーで、C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data フォルダーに移動します。
- GISDatabaseForXML ジオデータベースを右クリックし、[新規作成] をポイントして、[スケマティック データセット] をクリックします。
- 新しく作成するスケマティック データセットの名前として「XMLDataset」と入力し、Enter キーを押します。
- XMLDataset スケマティック データセットを右クリックし、[編集] をクリックします。
- データセット エディターのツリーで [XMLDataset] エントリを右クリックし、[新規スケマティック ダイアグラム テンプレート] をクリックします。
- [名前] テキスト ボックスに「XMLDiagrams」と入力します。
- [スケマティック ビルダー] セクションで [XML ビルダー] を選択します。
- [スケマティック ビルダー プロパティ] をクリックし、[スケマティック フィーチャクラスの自動作成] をオンにします。
- [ビルダー プロパティ] ダイアログ ボックスを閉じます。
- [OK] をクリックします。
- [スケマティック データセット エディター] ツールバーの [保存] をクリックし、スケマティック データセット エディターを閉じます。
 
- 以下のスクリプトをコピーして、ArcCatalog または ArcMap Python ウィンドウに貼り付けます。
- Enter キーを押します。
# Name: UpdateDiagramXML.py
# Description: Update schematic diagrams based on the XML builder
# Requirement: ArcGIS Schematics extension
# import system modules
import arcpy
msgNoLicenseAvailable = "ArcGIS Schematics extension license required"
try:
    # Checks out the ArcGIS Schematics extension license
    if arcpy.CheckExtension("Schematics") == "Available":
        arcpy.CheckOutExtension("Schematics")
    else:
        raise Exception(msgNoLicenseAvailable)
    # Sets Schematics general settings
    dataLocation="C:/ArcGIS/ArcTutor/Schematics/Schematics_Configuration/XML_Data"
    gdbName="GISDatabaseForXML.gdb"
    in_schDataset="XMLDataset"
    in_diagName="XMLDiagramFeeder1"
    in_diagTempName="XMLDiagrams"
    input_XmlFile1="SampleNetworkFeeder1.xml"
    input_XmlFile2="SampleNetworkUpdatedFeeder1.xml"
    # Sets environment settings
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = dataLocation + "/" + gdbName
    # CreateDiagram from a XML file, SampleNetworkFeeder1.xml
    arcpy.CreateDiagram_schematics(in_schDataset, in_diagName, in_diagTempName, dataLocation + "/" + input_XmlFile1)
    # Updates the XMLDiagramFeeder1 diagram from another XML file, SampleNetworkUpdatedFeeder1.xml
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_diagName, dataLocation + "/" + input_XmlFile2)
    # Returns the ArcGIS Schematics extension license
    arcpy.CheckInExtension("Schematics")
    print "Script completed successfully"
except Exception as e:
    # If an error occurred, print line number and error message import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occured on line %i" % tb.tb_lineno
    print str(e)
UpdateDiagram (ダイアグラムの更新) とネットワーク データセット ビルダー - 例 4 (スタンドアロン Python スクリプト)
ネットワーク データセット ビルダーに基づくスケマティック ダイアグラムを更新します。この Python スクリプトの例の使用方法は次のとおりです。
- ArcMap を起動します。
- C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Network_Dataset に保存されている ParisTours.mxd ファイルを開きます。
- [ジオプロセシング] → [ジオプロセシング オプション] の順にクリックします。
- [バックグラウンド処理] セクションの [有効] をオフにして、[OK] をクリックします。
- 以下のスクリプトをコピーして Python ウィンドウに貼り付けます。
# Name: UpdateDiagramNDS.py
# Description: Update sample schematic diagrams based on the Network Dataset builder
# Requirement: ArcGIS Schematics extension,ArcGIS Network Analyst extension 
# import system modules
import arcpy
msgNoLicenseSchematicsAvailable = "ArcGIS Schematics extension license required"
msgNoLicenseNetworkAnalystAvailable = "ArcGIS Network Analyst extension license required"
try:
    # Checks out the ArcGIS Schematics extension licence
    if arcpy.CheckExtension("Schematics") == "Available":
        arcpy.CheckOutExtension("Schematics")
    else:
        raise Exception(msgNoLicenseSchematicsAvailable)
    # Checks out the ArcGIS Network Analyst extension licence
    if arcpy.CheckExtension("Network") == "Available":
        arcpy.CheckOutExtension("Network")
    else:
        raise Exception(msgNoLicenseNetworkAnalystAvailable)
    # Sets general settings
    dataLocation="C:/ArcGIS/ArcTutor/Schematics/Schematics_Configuration/Network_Dataset"
    gdbName="NetworkAnalyst_Schematics.gdb"
    in_schDataset="NA_SchematicDataset"
    in_diagAName="DiagramTour2_A"
    in_diagBName="DiagramTour2_B"
    in_diagTempName="NADiagrams"
    in_NALayerName="Routes/Tour2"
    # builder_options variables for diagram Generation and Update
    G_option1="MERGE_NODES"
    G_option2="NO_MERGE_NODES"
    U_option1="NO_MERGE_NODES;KEEP_MANUAL_MODIF"
    U_option2="MERGE_NODES;KEEP_MANUAL_MODIF"
    # Sets environment settings
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = dataLocation + "/" + gdbName
    # UpdateDiagram from a solved route network analysis layer
    # 1) Solves the route network analysis layer, 
    arcpy.Solve_na(in_NALayerName)
    # 2) Creates diagrams from this solved route network analysis layer
    # a - A diagram where a single node is created to represent a GIS point crossed N times along this route (G_option1)
    arcpy.CreateDiagram_schematics(in_schDataset, in_diagAName, in_diagTempName, in_NALayerName, G_option1)
    # b - A diagram where N nodes are created to represent a GIS point crossed N times along this route (G_option2)
    arcpy.CreateDiagram_schematics(in_schDataset, in_diagBName, in_diagTempName, in_NALayerName, G_option2)
    # 3) Updates those diagrams from the same solved route network analysis layer by changing the merge nodes option
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_diagAName, in_NALayerName, U_option1)
    arcpy.UpdateDiagram_schematics(in_schDataset + "/" + in_diagBName, in_NALayerName, U_option2)
    # Returns the licences
    arcpy.CheckInExtension("Schematics")
    arcpy.CheckInExtension("Network")
    print "Script completed successfully"
except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occurred on line %i" % tb.tb_lineno
    print str(e)
環境
このツールは、ジオプロセシング環境を使用しません。
ライセンス情報
- Basic: 次のものが必要 スケマティクス
- Standard: 次のものが必要 スケマティクス
- Advanced: 次のものが必要 スケマティクス