更新逻辑示意图 (Schematics)

摘要

更新逻辑示意图。根据逻辑示意图构建器的不同,可基于要素图层、要素类、对象表、已求解的网络分析或 XML 文件来更新逻辑示意图。

用法

语法

UpdateDiagram_schematics (in_diagram, {in_data}, {builder_options})
参数说明数据类型
in_diagram

要更新的逻辑示意图。

Schematic Diagram; Schematic Layer
in_data
[in_data,...]
(可选)

更新逻辑示意图时所依据的输入数据。

对于所有预定义的构建器,输入数据参数并不是必需的;该参数为可选参数:

  • 对于使用配置为根据自定义查询进行操作的“标准构建器”的逻辑示意图模板,不必设置输入表。
  • 对于使用“XML 构建器”的逻辑示意图模板,“输入数据”参数必须引用 XML 文件。
  • 对于使用“网络数据集构建器”的逻辑示意图模板,必须指定输入数据。该参数必须引用唯一的网络分析图层。如果未执行相关网络分析,则在将已求解的分析图层用作输入之前,Schematics 会尝试执行该网络分析。
  • 对于使用配置为根据几何网络进行操作的“标准构建器”的逻辑示意图模板,如果未指定“输入数据”参数,则“更新逻辑示意图”工具会根据用于生成逻辑示意图的要素/对象的初始设置,或者根据基于追踪参数(如果逻辑示意图根据高亮显示的追踪生成,则该参数保留在逻辑示意图数据集中)的更新追踪结果进行处理。如果指定了“输入数据”参数,则该参数必须至少引用一个要素图层、要素类或对象表,这样才会根据“构建器选项”的值对此数据进行更新。

TableView; Layer; Data Element
builder_options
[builder_options,...]
(可选)

逻辑示意图构建器更新选项。更新选项是可选的。它们取决于与实现指定逻辑示意图的逻辑示意图模板相关的构建器。

根据自定义查询(标准构建器)生成的逻辑示意图:KEEP_MANUAL_MODIFNO_KEEP_MANUAL_MODIF

根据 XML 数据(XML 构建器)生成的逻辑示意图:KEEP_MANUAL_MODIFNO_KEEP_MANUAL_MODIF

根据网络数据集(网络数据集构建器)上的求解程序结果生成的逻辑示意图:MERGE_NODESNO_MERGE_NODESKEEP_MANUAL_MODIFNO_KEEP_MANUAL_MODIF

根据构成几何网络(标准构建器)的要素生成的逻辑示意图:REBUILDAPPENDKEEP_MANUAL_MODIFNO_KEEP_MANUAL_MODIF

  • KEEP_MANUAL_MODIF默认选项。如果希望已从逻辑示意图中移除/减去的逻辑示意图要素不再出现,且希望在更新后的逻辑示意图中仍保留经过编辑的连接,可以使用此选项。
  • NO_KEEP_MANUAL_MODIF如果希望在更新后恢复那些已移除/减去的逻辑示意图要素以及重新连接的逻辑示意图要素连接线,可以使用此选项。
  • NO_MERGE_NODES基于“网络数据集构建器”的逻辑示意图的默认选项。如果希望在更新的逻辑示意图中不合并逻辑示意图要素结点,请使用此选项。
  • MERGE_NODES基于“网络数据集构建器”的逻辑示意图的可用选项。如果想要沿路径分析所生成的路径多次出现的网络元素连接点可由更新的逻辑示意图中的单个逻辑示意图要素结点表示,请使用此选项。如果是服务区分析,当中跨交汇点元素处于相同位置时,可使用该选项来合并这些元素。
  • REBUILD设置输入数据时,基于“标准构建器”的逻辑示意图的可用默认选项。如果想要根据指定的输入要素图层、要素类或对象表完全重新构建指定的逻辑示意图,可以使用该选项。
  • APPEND设置输入数据时,基于“标准构建器”的逻辑示意图的可用选项。如果想要执行以下操作,可使用该选项:保留最初用于生成指定逻辑示意图的所有逻辑示意图要素;添加与指定的输入要素图层关联的逻辑示意图对象、要素类或对象表;更新所有逻辑示意图内容。
String

代码示例

示例 1:UpdateDiagram 和根据自定义查询进行处理的“标准构建器”

更新完全通过自定义查询构建的逻辑示意图。这种情况下,只需要逻辑示意图名称参数。

# Name: UpdateDiagramCustomQuery.py # Description: Update a schematic diagram entirely built from custom queries # Author: ESRI  # import system modules import arcpy msgNoLicenseAvailable = "Schematics license required"  try: 	# Check out the ArcGIS Schematic extension license 	if arcpy.CheckExtension("Schematics") == "Available": 		arcpy.CheckOutExtension("Schematics") 	else: 		raise Exception(msgNoLicenseAvailable) 	 	# Set environment settings 	arcpy.OverWriteOutput = True 	arcpy.env.workspace = "C:\ArcGIS\ArcTutor\Schematics\Schematics_In_ArcMap\ElecDemo.gdb"  	#Process: Update the 'Substation 08' schematic diagram. 	arcpy.UpdateDiagram_schematics("ElecDemo\Inside Plants\Substation 08")  	# Returns the schematic license 	arcpy.CheckInExtension("Schematics")  except Exception as exc: 		print exc
示例 2:UpdateDiagram 和处理几何网络数据的“标准构建器”

更新通过构成几何网络的要素构建的逻辑示意图。

# Name: UpdateDiagramStd.py # Description: Update schematic diagrams built from features organized into a geometric network # Author: ESRI  # import system modules import arcpy msgNoLicenseAvailable = "Schematics license required"  try: 	# Check out the ArcGIS Schematic extension license 	if arcpy.CheckExtension("Schematics") == "Available": 		arcpy.CheckOutExtension("Schematics") 	else: 		raise Exception(msgNoLicenseAvailable) 	 	# Set environment settings 	arcpy.OverWriteOutput = True 	arcpy.env.workspace = "C:\ArcGIS\ArcTutor\Schematics\Schematics_In_ArcMap\ElecDemo.gdb"  	#Process: CreateDiagram from the Feeder feature class: A diagram containing schematic features associated with each GIS feature stored in that feature class will be created. 	arcpy.CreateDiagram_schematics("ElecDemo", "FeederDiagram", "GeoSchematic", "ElectricNetwork\Feeder")  	#Process: CreateDiagram based on all the edge feature classes contained in a geometric network. A diagram containing schematic features associated with all the GIS features in that geometric network will be created. 	arcpy.CreateDiagram_schematics("ElecDemo", "ElectricNetworkDiagram", "GeoSchematic", "ElectricNetwork\PrimaryLine;ElectricNetwork\SecondaryLine")  	#Process: CreateDiagram based on all primary lines Phase ABC 	# 1) Create a layer with the selection  	InputLayer = arcpy.MakeFeatureLayer_management(r'ElectricNetwork\PrimaryLine',"PrimaryLineLayer", "[PHASECODE] =135") 	# 2) Use the layer as input of CreateDiagram 	arcpy.CreateDiagram_schematics("ElecDemo", "ElectricMainNetworkDiagram", "GeoSchematic", InputLayer)  	#Process: Updating the FeederDiagram diagram without optional parameter: the update operates from the initial feature set used to initially generate the specified schematic diagram or from the updated trace result based on the trace parameters that were persisted in the schematic database if the diagram was generated from an highlighted trace. 	arcpy.UpdateDiagram_schematics("ElecDemo\FeederDiagram")  	#Process: Update the ElectricNetworkDiagram-With Removed diagram with the KEEP_MANUAL_MODIF optional parameter: the update operates from the initial feature set used to initially generate the specified schematic diagram or from the updated trace result based on the trace parameters that persisted in the schematic database if the diagram was generated from an highlighted trace, schematic features that have been manually reduced or removed, and schematic feature links that have been reconnected in the diagram after its generation being kept as removed/reduced/reconnected schematic features. 	arcpy.UpdateDiagram_schematics("ElecDemo\ElectricNetworkDiagram-WithRemoved", "#", "KEEP_MANUAL_MODIF")  	#Process: Update the ElectricNetworkDiagram diagram using a set of feature classes to rebuild it. 	arcpy.UpdateDiagram_schematics("ElecDemo\ElectricNetworkDiagram", "ElectricNetwork\PrimaryLine;ElectricNetwork\SecondaryLine", "REBUILD")  	#Process: UpdateDiagram on the FeederDiagramBIS diagram by appending new features 	arcpy.UpdateDiagram_schematics("ElecDemo\FeederDiagramBIS", "ElectricNetwork\Substation", "APPEND")  	#Process: Update the ElectricMainNetworkDiagram diagram using an updated selection of features 	InputLayer = arcpy.MakeFeatureLayer_management(r'ElectricNetwork\PrimaryLine',"PrimaryLineLayer", "[PHASECODE] =135") 	arcpy.UpdateDiagram_schematics("ElecDemo\ElectricMainNetworkDiagram", InputLayer, "REBUILD") 	 	# Returns the schematic license 	arcpy.CheckInExtension("Schematics")  except Exception as exc: 		print exc
示例 3:UpdateDiagram 和“XML 构建器”

更新基于“XML 构建器”的逻辑示意图。

# Name: UpdateDiagramXML.py # Description: Update schematic diagrams based on the XML builder # Author: ESRI  # import system modules import arcpy msgNoLicenseAvailable = "Schematics license required"  try: 	# Check out the ArcGIS Schematic extension license 	if arcpy.CheckExtension("Schematics") == "Available": 		arcpy.CheckOutExtension("Schematics") 	else: 		raise Exception(msgNoLicenseAvailable) 	 	# Set environment settings 	arcpy.OverWriteOutput = True 	arcpy.env.workspace = "C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data\GISDatabaseForXML.gdb"  	#Process: Update the XMLDiagramSample diagram from the SampleTutorialData.xml file based on the XMLBuilderDiagram XML Schema file 	arcpy.UpdateDiagram_schematics("XMLSampleSchDataset\XMLDiagramSample", "C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data\SampleNetworkUpdatedFeeder1.xml")  	# Returns the schematic license 	arcpy.CheckInExtension("Schematics")  	# Returns the schematic license 	arcpy.CheckInExtension("Schematics")  except Exception as exc: 		print exc
示例 4:UpdateDiagram 和“网络数据集构建器”

更新基于“网络数据集构建器”的逻辑示意图。

# Name: UpdateDiagramNDS.py # Description: Update schematic diagrams based on the Network Dataset builder # Author: ESRI  # import system modules import arcpy msgNoLicenseAvailable = "Schematics license required"  try: 	# Check out the ArcGIS Schematic extension license 	if arcpy.CheckExtension("Schematics") == "Available": 		arcpy.CheckOutExtension("Schematics") 	else: 		raise Exception(msgNoLicenseAvailable) 	 	# Set environment settings 	arcpy.OverWriteOutput = True 	arcpy.env.workspace = "C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Network_Dataset\NetworkAnalyst_Schematics.gdb"  	#Solving the Route network analysis layer 	arcpy.solve("Route", "HALT")  	#Process: Update the DiagramRoute1_MERGED and DiagramRoute1_NOTMERGED diagrams from the solved Route network analysis layer 	arcpy.UpdateDiagram_schematics("NA_SchematicDataset\DiagramRoute1_MERGED", "Route", "MERGE_NODES") 	arcpy.UpdateDiagram_schematics("NA_SchematicDataset\DiagramRoute1_NOTMERGED", "Route", "NO_MERGE_NODES")  except Exception as exc: 		print exc

环境

此工具不使用任何地理处理环境

相关主题

许可信息

ArcView: 需要 Schematics
ArcEditor: 需要 Schematics
ArcInfo: 需要 Schematics

7/10/2012