Update Diagram (Schematics)
Récapitulatif
Updates a schematic diagram. Depending on the schematic builder, the diagram update can be based on feature layers, feature classes, object tables, a solved network analysis, or an XML file.
Utilisation
-
The Input Data parameter is mandatory for diagrams working with the Network Dataset builder and XML builder. It is optional for diagrams working with the Standard builder when it is configured to operate from geometric network data. It must not be specified for diagrams that work with the Standard builder when it is configured to operate from custom queries.
-
When using the Update Diagram tool on diagrams implemented by the Standard builder that have been generated from a trace, the update operates from the updated trace result based on the trace parameters that persisted in the schematic dataset the first time the diagram was generated from a highlighted trace.
-
When the update must operate from features that compose a geometric network, it is not necessary to specify all the feature layers in the Input Data parameter. If the Add connected nodes option is specified for the Standard builder properties, only the feature layers related to edge features can be specified, even if all the feature layers related to the geometric network (junctions and edges) will be used for update.
-
If a particular layout was saved for the specified schematic diagram, the schematic features that were in the diagram before updating are displayed according to their last saved position, and new schematic features that may have been introduced during the update are positioned at their geographic coordinates.
Syntaxe
Paramètre | Explication | Type de données |
in_diagram |
The schematic diagram to be updated. | Schematic Diagram; Schematic Layer |
in_data [in_data,...] (Facultatif) |
The input data on which the diagram update will be based. The Input Data parameter is not required for all predefined builders; it's an optional parameter:
| TableView; Layer; Data Element |
builder_options [builder_options,...] (Facultatif) |
The schematic builder update options. Update options are optional. They depend on the builder related to the diagram template that implements the specified schematic diagram. Diagrams generated from custom queries (Standard builder): KEEP_MANUAL_MODIF or NO_KEEP_MANUAL_MODIF. Diagrams generated from XML data (XML builder): KEEP_MANUAL_MODIF or NO_KEEP_MANUAL_MODIF. Diagrams generated from solver results on network datasets (Network Dataset builder): MERGE_NODES or NO_MERGE_NODES, KEEP_MANUAL_MODIF or NO_KEEP_MANUAL_MODIF Diagrams generated from features organized into a geometric network (Standard builder): REBUILD or APPEND, KEEP_MANUAL_MODIF or NO_KEEP_MANUAL_MODIF.
| String |
Exemple de code
Update a schematic diagram entirely built from custom queries. In this case, only the diagram name parameter is required.
# 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
Update schematic diagrams built from features organized into a geometric network.
# 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
Update a schematic diagram based on the XML builder.
# 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
Update schematic diagrams based on the Network Dataset builder.
# 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