创建逻辑示意图 (Schematics)
摘要
此工具可创建逻辑示意图。取决于逻辑示意图构建器,可基于要素图层、要素类、对象表、网络分析图层或 XML 数据创建逻辑示意图。
用法
-
如果输出逻辑示意图名称已存在,其可能在重新创建之前被删除。为避免被删除,可以取消选中地理处理选项 对话框中的覆盖地理处理操作的输出框。
-
取决于与为要创建的逻辑示意图指定的逻辑示意图模板相关的逻辑示意图构建器,确定是否需要输入数据参数:
- 对于基于配置成通过几何网络操作时选择“标准构建器”的逻辑示意图模板,此参数必需。指定的输入表可以是要素图层、要素类或对象表。
- 对于基于网络数据集构建器的逻辑示意图模板,必须为“输入数据”参数指定唯一的网络分析图层。
- 对于基于 XML 构建器的逻辑示意图模板,必须为“输入数据”参数指定唯一 XML 文件。
- 对于基于配置成通过自定义查询操作时选择“标准构建器”的逻辑示意图模板,不需要输入数据。
语法
CreateDiagram_schematics (out_location, out_name, diagram_type, {in_data}, {builder_options})
参数 | 说明 | 数据类型 |
out_location |
要在其中创建逻辑示意图的逻辑示意图数据集或逻辑示意图文件夹。 警告: 此容器必须已经存在。 | Schematic dataset;Schematic folder |
out_name |
要创建的逻辑示意图的名称。 | String |
diagram_type [diagram_type,...] |
要创建的逻辑示意图的逻辑示意图模板。 | |
in_data (可选) |
生成逻辑示意图所需的输入数据。 输入数据参数可指定生成逻辑示意图要基于的元素。对于大多数预定义的逻辑示意图构建器而言其是必选参数:
警告: 对于使用“标准构建器”的逻辑示意图模板(当其配置成通过几何网络、“XML 构建器”和“网络数据集构建器”操作时),如果未指定输入数据,则不能生成逻辑示意图。 | Tableview;Layer;Data element |
builder_options (可选) |
逻辑示意图构建器创建参数。这些参数可选;它们仅供基于“网络数据集构建器”的逻辑示意图指定是否合并结点。其他逻辑示意图构建器不需要任何选项。
| String |
代码示例
示例 1:CreateDiagram 和处理几何网络数据的“标准构建器”
通过按几何网络形式组织的 GIS 要素创建逻辑示意图。
# Name: CreateDiagramStd.py # Description: Create schematic diagrams from GIS 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 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) # Returns the schematic license arcpy.CheckInExtension("Schematics") except Exception as exc: print exc
示例 2:CreateDiagram 和网络数据集构建器
通过求解的网络分析图层创建逻辑示意图。
# Name: CreateDiagramNDS.py # Description: Create 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) # Check out the Network Analyst extension license if arcpy.CheckExtension("Network Analyst") == "Available": arcpy.CheckOutExtension("Network Analyst") else: raise Exception(msgNoLicenseNetworkAnalystAvailable) # 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: CreateDiagram from the solved Route network analysis layer: A diagram containing schematic features associated with each route objects in that network analysis layer will be created. Depending on the MERGE_NODES and NO_MERGE_NODES option, network element junctions which are taken several times along the resultant route will be represented by a single schematic feature node in the generated schematic diagram (MERGE_NODES) or not (NO_MERGE_NODES) arcpy.CreateDiagram_schematics("NA_SchematicDataset", "DiagramRoute1_MERGED", "NADiagrams", "Route", "MERGE_NODES") arcpy.CreateDiagram_schematics("NA_SchematicDataset", "DiagramRoute1_NOTMERGED", "NADiagrams", "Route", "NO_MERGE_NODES") # Returns the schematic license arcpy.CheckInExtension("Schematics") arcpy.CheckInExtension("Network Analyst") except Exception as exc: print exc
示例 3:CreateDiagram 和 XML 构建器
基于“XML 构建器”创建逻辑示意图。
# Name: CreateDiagramXML.py # Description: Create a schematic diagram 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: CreateDiagram from the SampleNetworkData.xml file based on the XMLBuilderDiagram XML Schema file: A diagram containing schematic features associated with each element stored in that XML file will be created. arcpy.CreateDiagram_schematics("XMLSampleSchDataset", "XMLDiagramSample", "XMLDiagrams", "C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data\SampleNetworkFeeder1.xml") # Returns the schematic license arcpy.CheckInExtension("Schematics") except Exception as exc: print exc
示例 4:CreateDiagram 和使用自定义查询的标准构建器
通过自定义查询创建逻辑示意图。
# Name: CreateDiagramCustomQuery.py # Description: Create a schematic diagram 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: CreateDiagram from the InsidePlants diagram template. arcpy.CreateDiagram_schematics("ElecDemo\Inside Plants", "Substation 08", "InsidePlants") # Returns the schematic license arcpy.CheckInExtension("Schematics") except Exception as exc: print exc
环境
相关主题
许可信息
ArcView: 需要 Schematics
ArcEditor: 需要 Schematics
ArcInfo: 需要 Schematics
7/10/2012