更新逻辑示意图 (Schematics)
摘要
更新逻辑示意图。根据逻辑示意图构建器的不同,可基于要素图层、要素类、对象表、已求解的网络分析或 XML 文件来更新逻辑示意图。
用法
-
对于使用网络数据集构建器和 XML 构建器的逻辑示意图,输入数据参数是不可或缺的。对于使用配置为根据几何网络数据进行操作的标准构建器的逻辑示意图,该参数为可选参数。对于使用配置为根据自定义查询进行操作的标准构建器的逻辑示意图,不得指定该参数。
-
当对已从追踪中生成的标准构建器所实现的逻辑示意图使用“更新逻辑示意图”工具时,更新会通过基于追踪参数(根据高亮显示的追踪首次生成逻辑示意图时,会在逻辑示意图数据集中保留该参数)的更新追踪结果进行操作。
-
当必须从组成几何网络的要素中执行更新过程时,不必在输入数据参数中指定所有要素图层。如果为“标准构建器”属性指定了添加连接的结点选项,则即使与该几何网络(交汇点和边)相关的所有要素图层都将用于更新,也只能指定与边要素相关的要素图层。
-
如果为指定的逻辑示意图保存了特定布局,则会根据更新前逻辑示意图中逻辑示意图要素上次保存的位置来显示这些要素,而更新期间可能引入的新逻辑示意图要素将定位在其地理坐标处。
语法
参数 | 说明 | 数据类型 |
in_diagram |
要更新的逻辑示意图。 | Schematic Diagram; Schematic Layer |
in_data [in_data,...] (可选) |
更新逻辑示意图时所依据的输入数据。 对于所有预定义的构建器,输入数据参数并不是必需的;该参数为可选参数:
| TableView; Layer; Data Element |
builder_options [builder_options,...] (可选) |
逻辑示意图构建器更新选项。更新选项是可选的。它们取决于与实现指定逻辑示意图的逻辑示意图模板相关的构建器。 根据自定义查询(标准构建器)生成的逻辑示意图:KEEP_MANUAL_MODIF 或 NO_KEEP_MANUAL_MODIF。 根据 XML 数据(XML 构建器)生成的逻辑示意图:KEEP_MANUAL_MODIF 或 NO_KEEP_MANUAL_MODIF。 根据网络数据集(网络数据集构建器)上的求解程序结果生成的逻辑示意图:MERGE_NODES 或 NO_MERGE_NODES、KEEP_MANUAL_MODIF 或 NO_KEEP_MANUAL_MODIF 根据构成几何网络(标准构建器)的要素生成的逻辑示意图:REBUILD 或 APPEND、KEEP_MANUAL_MODIF 或 NO_KEEP_MANUAL_MODIF。
| String |
代码示例
更新完全通过自定义查询构建的逻辑示意图。这种情况下,只需要逻辑示意图名称参数。
# 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
更新通过构成几何网络的要素构建的逻辑示意图。
# 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
更新基于“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
更新基于“网络数据集构建器”的逻辑示意图。
# 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