| ラベル | 説明 | データ タイプ | 
| 入力ネットワーク | ダイアグラム テンプレート名が関連付けられているユーティリティ ネットワークまたはトレース ネットワーク。 | Utility Network; Trace Network | 
派生した出力
| ラベル | 説明 | データ タイプ | 
| 出力ダイアグラム テンプレート | 出力ダイアグラム テンプレート名。 | String | 
ネットワークに関連するすべてのダイアグラム テンプレートの名前を返します。
このツールは、ユーティリティ ネットワーク サービスまたはトレース ネットワーク サービスを使用する場合、サポートされません。 ファイルまたはモバイル ジオデータベース内のユーティリティ ネットワークまたはトレース ネットワークを使用するか、エンタープライズ ジオデータベース内のユーティリティ ネットワークまたはトレース ネットワークへのデータベース コネクションを使用する必要があります。 エンタープライズ ジオデータベースを操作する場合、次の要件があります。
このツールは主に、ModelBuilder または Python での実行中にダイアグラム テンプレートでループ処理を行うために使用されます。
| ラベル | 説明 | データ タイプ | 
| 入力ネットワーク | ダイアグラム テンプレート名が関連付けられているユーティリティ ネットワークまたはトレース ネットワーク。 | Utility Network; Trace Network | 
| ラベル | 説明 | データ タイプ | 
| 出力ダイアグラム テンプレート | 出力ダイアグラム テンプレート名。 | String | 
arcpy.nd.GetDiagramTemplateNames(in_utility_network)
| 名前 | 説明 | データ タイプ | 
| in_utility_network | ダイアグラム テンプレート名が関連付けられているユーティリティ ネットワークまたはトレース ネットワーク。 | Utility Network; Trace Network | 
| 名前 | 説明 | データ タイプ | 
| out_template_names | 出力ダイアグラム テンプレート名。 | String | 
指定されたネットワークに関連するすべてのダイアグラム テンプレートの定義をエクスポートします。
次のスクリプト ツールは、ネットワークに関連するダイアグラム テンプレートのリストを取得し、各テンプレートの定義を指定されたフォルダー内の *.ndbd ファイルと *.ndld ファイルにエクスポートします。
このスクリプト ツールを追加および構成するには、次の手順に従います。
このスクリプト ツールを実行するには、次の手順に従います。
# Name: ExportAllDiagramTemplateDefinitions.py
# Description: Export definitions of all diagram templates related to a given network.
# Import system modules
import arcpy
import os
import re
# Initialize variables
msgInputsErr = "Invalid arguments."
msgScriptErr = "Error during script operation."
ndbd_ext = ".ndbd"
ndld_ext = ".ndld"
# Set overwrite option
arcpy.env.overwriteOutput = True
# Decodes parameters
try:
    input_Network = arcpy.GetParameterAsText(0)
    input_Folder = arcpy.GetParameterAsText(1)
    if input_Network == "" or input_Folder == "" :
        raise Exception()
except Exception:
    arcpy.AddError(msgInputsErr)
    raise
# Main code
try:
    arcpy.AddMessage("Retrieving the templates list...")
    output_TemplateNames = arcpy.GetDiagramTemplateNames_nd(input_Network)
    templateNamesList = re.split(';', str(output_TemplateNames))
    arcpy.AddMessage("Looping on each template...")
    for template in templateNamesList:
        message = "Exporting template: {}".format(template)
        arcpy.AddMessage(message)
        arcpy.ExportDiagramTemplateDefinitions_nd(input_Network, template, 
                                                  os.path.join(input_Folder, template + ndbd_ext), 
                                                  os.path.join(input_Folder, template + ndld_ext))
except Exception:
    arcpy.AddError(msgScriptErr)
    raise