Update Diagram (Schematics)

Nivel de licencia:BasicStandardAdvanced

Resumen

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.

Uso

Sintaxis

UpdateDiagram_schematics (in_diagram, {in_data}, {builder_options})
ParámetroExplicaciónTipo de datos
in_diagram

The schematic diagram layer to be updated.

Schematic Layer
in_data
[in_data,...]
(Opcional)

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:

  • For diagram templates that work with the Standard builder configured to operate from custom queries, no input tables must be set.
  • For diagram templates that work with the XML builder, the Input Data parameter must reference an XML file.
  • For diagram templates that work with the Network Dataset builder, the input data must be specified. It must reference a unique network analysis layer. If the related network analysis is not performed, Schematics tries to perform it before using the solved analysis layer as input.
  • For diagram templates that work with the Standard builder configured to operate from a geometric network or a network dataset, when the Input Data parameter is not specified, the Update Diagram tool works from the initial set of network features/objects used to generate the diagram or from the updated geometric network trace result based on the trace parameters that persisted in the schematic database if the diagram was generated from a highlighted trace. When the Input Data parameter is specified, it must reference at least a feature layer, feature class, or object table so the update operates on this data according to the Builder Options value.

Table View;Data Element;Layer
builder_options
[builder_options,...]
(Opcional)

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, NO_KEEP_MANUAL_MODIF, or REFRESH.
  • 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): NO_MERGE_NODES;KEEP_MANUAL_MODIF, NO_MERGE_NODES;NO_KEEP_MANUAL_MODIF, MERGE_NODES;KEEP_MANUAL_MODIF or MERGE_NODES;NO_KEEP_MANUAL_MODIF.
  • Diagrams generated from features organized into a geometric network or a network dataset (Standard builder):
    • When the Input Data parameter is not specified—KEEP_MANUAL_MODIF, NO_KEEP_MANUAL_MODIF, or REFRESH
    • When the Input Data parameter is specified—REBUILD;KEEP_MANUAL_MODIF, REBUILD;NO_KEEP_MANUAL_MODIF, APPEND;KEEP_MANUAL_MODIF, APPEND;NO_KEEP_MANUAL_MODIF, APPEND_QUICK;KEEP_MANUAL_MODIF or APPEND_QUICK;NO_KEEP_MANUAL_MODIF

  • KEEP_MANUAL_MODIFDefault option for diagram based on the XML builder or on the Standard builder when no input data is set. Use it to synchronize the input diagram content either against the original selection/trace/query used to initially generate this diagram—Standard diagram—or from an updated version of the XML input data initially used to generate it—XML diagram—whereas the schematic features that may have been manually removed/reduced/reconnected are kept in the updated diagram.
  • NO_KEEP_MANUAL_MODIFOption available for diagrams based on the XML builder or on the Standard builder when no input data is set. Use it to synchronize the input diagram content either against the original selection/trace/query used to initially generate this diagram—Standard diagram—or from an updated version of the XML input data initially used to generate it—XML diagram—whereas the schematic features that may have been manually removed/reduced/reconnected are restored in the updated diagram.
  • REFRESHOption available for diagrams based on the Standard builder when no input data is set. Use it to simply refresh the attributes for all schematic features in the input diagram to the current state of the related network features in the geometric network or network dataset feature classes.
  • REBUILD;KEEP_MANUAL_MODIFDefault option available for diagrams based on the Standard builder when input data is set. Use this option if you want the input diagram to be completely rebuilt according to the specified input feature layers, feature classes, or object tables, whereas the schematic features that may have been manually removed/reduced/reconnected are kept in the updated diagram.
  • REBUILD;NO_KEEP_MANUAL_MODIFOption available for diagrams based on the Standard builder when input data is set. Use this option if you want the input diagram to be completely rebuilt according to the specified input feature layers, feature classes, or object tables, whereas the schematic features that may have been manually removed/reduced/reconnected are restored in the updated diagram.
  • APPEND;KEEP_MANUAL_MODIFOption available for diagrams based on the Standard builder when input data is set. Use this option if you want to append schematic features associated with the specified input feature layers, feature classes, or object tables with a full synchronization of the input diagram content, whereas the schematic features that may have been manually removed/reduced/reconnected are kept in the updated diagram.
  • APPEND;NO_KEEP_MANUAL_MODIFOption available for diagrams based on the Standard builder when input data is set. Use this option if you want to append schematic features associated with the specified input feature layers, feature classes, or object tables with a full synchronization of the input diagram content, whereas the schematic features that may have been manually removed/reduced/reconnected are restored in the updated diagram.
  • APPEND_QUICK;KEEP_MANUAL_MODIFOption available for diagrams based on the Standard builder when input data is set. Use this option if you want to append schematic features associated with the specified input feature layers, feature classes, or object tables with a partial synchronization of the input diagram content, whereas the schematic features that may have been manually removed/reduced/reconnected are kept in the updated diagram.
  • APPEND_QUICK;NO_KEEP_MANUAL_MODIFOption available for diagrams based on the Standard builder when input data is set. Use this option if you want to append schematic features associated with the specified input feature layers, feature classes, or object tables with a partial synchronization of the input diagram content, whereas the schematic features that may have been manually removed/reduced/reconnected are restored in the updated diagram.
  • NO_MERGE_NODES;KEEP_MANUAL_MODIFDefault option for diagrams based on the Network Dataset builder. Use this option to update the input diagram from the specified solved network analysis layer without merging nodes that occur several times in this layer, whereas the schematic features that may have been manually removed/reduced/reconnected are kept in the updated diagram.
  • NO_MERGE_NODES;NO_KEEP_MANUAL_MODIFOption available for diagrams based on the Network Dataset builder. Use this option to update the input diagram from the specified solved network analysis layer without merging nodes that occur several times in this layer, whereas the schematic features that may have been manually removed/reduced/reconnected are restored in the updated diagram.
  • MERGE_NODES;KEEP_MANUAL_MODIFOption available for diagrams based on the Network Dataset builder. Use it to update the input diagram from the specified solved network analysis layer and merge nodes that occur several times in this layer, whereas the schematic features that may have been manually removed/reduced/reconnected are kept in the updated diagram.
  • MERGE_NODES;NO_KEEP_MANUAL_MODIFOption available for diagrams based on the Network Dataset builder. Use it to update the input diagram from the specified solved network analysis layer and merge nodes that occur several times in this layer, whereas the schematic features that may have been manually removed/reduced/reconnected are restored in the updated diagram.
String

Ejemplo de código

UpdateDiagram and Standard builder working from custom queries example 1 (stand-alone Python script)

Updates a sample schematic diagram entirely built from custom queries. In this case, only the diagram name parameter is required.

How to run this Python script example:

  1. Start ArcCatalog or ArcMap with a new empty map.
  2. Copy and paste the following script in the Python window.
  3. Press ENTER.

# Name: UpdateDiagramCustomQuery.py
# Description: Update a schematic diagram entirely built from custom queries
# Requirement: Extensión ArcGIS Schematics

# import system modules
import arcpy
msgNoLicenseAvailable = "Extensión ArcGIS Schematics license required"

try:
    # Checks out the Extensión ArcGIS Schematics license
    if arcpy.CheckExtension("Schematics") == "Available":
        arcpy.CheckOutExtension("Schematics")
    else:
        raise Exception(msgNoLicenseAvailable)

    # Sets environment settings
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = "C:\ArcGIS\ArcTutor\Schematics\Schematics_In_ArcMap\ElecDemo.gdb"

    # UpdateDiagram by only refreshing the attributes on schematic features contained in the input diagram; builder_options=REFRESH
    arcpy.UpdateDiagram_schematics("ElecDemo\Inside Plants\Substation 08", "#", "REFRESH")

    # UpdateDiagram by fully synchronizing the diagram content regarding the custom queries; no udpate parameters required
    arcpy.UpdateDiagram_schematics("ElecDemo\Inside Plants\Substation 08")

    # Returns the Extensión ArcGIS Schematics license
    arcpy.CheckInExtension("Schematics")

    print "Script completed successfully"

except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occurred on line %i" % tb.tb_lineno
    print str(e)
UpdateDiagram and Standard builder working on geometric network data example 2 (stand-alone Python script)

Updates sample schematic diagrams built from features organized into a geometric network.

How to run this Python script example:

  1. Start ArcCatalog or ArcMap with a new empty map.
  2. Copy and paste the following script in the Python window.
  3. Press ENTER.

# Name: UpdateDiagramStd.py
# Description: Update schematic diagrams built from features organized into a geometric network
# Requirement: Extensión ArcGIS Schematics

# import system modules
import arcpy
msgNoLicenseAvailable = "Extensión ArcGIS Schematics license required"

try:
    # Checks out the Extensión ArcGIS Schematics license
    if arcpy.CheckExtension("Schematics") == "Available":
        arcpy.CheckOutExtension("Schematics")
    else:
        raise Exception(msgNoLicenseAvailable)

    # Sets environment settings
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = "C:\ArcGIS\ArcTutor\Schematics\Schematics_In_ArcMap\ElecDemo.gdb"

    # Creates some new diagrams that will be used to exemplify the UpdateDiagram command:
    arcpy.CreateDiagram_schematics("ElecDemo", "FeederDiagram", "GeoSchematic", "ElectricNetwork\Feeder")
    arcpy.CreateDiagram_schematics("ElecDemo", "FeederDiagramBIS", "GeoSchematic", "ElectricNetwork\Feeder")
    arcpy.CreateDiagram_schematics("ElecDemo", "WholeElectricNetworkDiagram", "GeoSchematic", "ElectricNetwork\PrimaryLine;ElectricNetwork\SecondaryLine")
    InputLayer = arcpy.MakeFeatureLayer_management("ElectricNetwork\PrimaryLine","PrimaryLineLayer", "PHASECODE =135")
    arcpy.CreateDiagram_schematics("ElecDemo", "PrimaryLinesDiagram", "GeoSchematic", InputLayer)


    # UpdateDiagram by fully synchronizing the diagram content regarding the original network features that were used to initially generate it; no udpate parameters required
    arcpy.UpdateDiagram_schematics("ElecDemo\Feeders\Feeder 0801-Rice Creek")

    # UpdateDiagram by only refreshing the attributes on schematic features contained in the input diagram; builder_options=REFRESH
    arcpy.UpdateDiagram_schematics("ElecDemo\Feeders\Feeder 0802-Goldmine", "#", "REFRESH")

    # UpdateDiagram by rebuilding the input diagram from a feature class; builder_options=REBUILD;KEEP_MANUAL_MODIF or REBUILD;NO_KEEP_MANUAL_MODIF
    arcpy.UpdateDiagram_schematics("ElecDemo\WholeElectricNetworkDiagram", "ElectricNetwork\PrimaryLine", "REBUILD;KEEP_MANUAL_MODIF")

    # UpdateDiagram by appending new features to the input diagram with a partial synchronization of the diagram content; builder_options=APPEND_QUICK;KEEP_MANUAL_MODIF or APPEND_QUICK;NO_KEEP_MANUAL_MODIF
    arcpy.UpdateDiagram_schematics("ElecDemo\FeederDiagram", "ElectricNetwork\Substation", "APPEND_QUICK;KEEP_MANUAL_MODIF")

    # UpdateDiagram by appending new features to the input diagram with a full synchronization of the diagram content; builder_options=APPEND;KEEP_MANUAL_MODIF or APPEND;NO_KEEP_MANUAL_MODIF
    arcpy.UpdateDiagram_schematics("ElecDemo\FeederDiagramBIS", "ElectricNetwork\ServiceLocation", "APPEND;KEEP_MANUAL_MODIF")

    # UpdateDiagram by rebuilding the input diagram from an input layer; builder_options=REBUILD;KEEP_MANUAL_MODIF or REBUILD;NO_KEEP_MANUAL_MODIF
    arcpy.UpdateDiagram_schematics("ElecDemo\PrimaryLinesDiagram", InputLayer, "REBUILD;KEEP_MANUAL_MODIF")
	
    # Returns the Extensión ArcGIS Schematics license
    arcpy.CheckInExtension("Schematics")

    print "Script completed successfully"

except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occurred on line %i" % tb.tb_lineno
    print str(e)
UpdateDiagram and XML builder example 3 (stand-alone Python script)

Updates a sample schematic diagram based on the XML builder.

How to run this Python script example:

  1. Start ArcCatalog.
  2. Create and configure the schematic dataset used during the sample script:
    • Navigate to the C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data folder in the Catalog tree.
    • Right-click the GISDatabaseForXML geodatabase, point to New, then click Schematic Dataset.
    • Type XMLDataset for the newly created schematic dataset's name, and press ENTER.
    • Right-click the XMLDataset schematic dataset and click Edit.
    • Right-click the XMLDataset entry in the Dataset Editor tree and click New Schematic Diagram Template.
    • Type XMLDiagrams in the Name text box.
    • Choose XML Builder in the Schematic Builder section.
    • Click Schematic Builder Properties, and check Automatic schematic feature class creation.
    • Close the Builder Properties dialog box.
    • Click OK.
    • Click Save on the Schematic Dataset Editor toolbar, and close the Schematic Dataset Editor.
  3. Copy and paste the following script in the ArcCatalog or ArcMap Python window.
  4. Press ENTER.

# Name: UpdateDiagramXML.py
# Description: Update schematic diagrams based on the XML builder
# Requirement: Extensión ArcGIS Schematics

# import system modules
import arcpy
msgNoLicenseAvailable = "Extensión ArcGIS Schematics license required"

try:
    # Checks out the Extensión ArcGIS Schematics license
    if arcpy.CheckExtension("Schematics") == "Available":
        arcpy.CheckOutExtension("Schematics")
    else:
        raise Exception(msgNoLicenseAvailable)

    # Sets environment settings
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = "C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data\GISDatabaseForXML.gdb"

    # CreateDiagram from a XML file, SampleNetworkFeeder1.xml
    arcpy.CreateDiagram_schematics("XMLDataset", "XMLDiagramFeeder1", "XMLDiagrams", "C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data\SampleNetworkFeeder1.xml")

    # Updates the XMLDiagramFeeder1 diagram from another XML file, SampleNetworkUpdatedFeeder1.xml
    arcpy.UpdateDiagram_schematics("XMLDataset\XMLDiagramFeeder1", "C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data\SampleNetworkUpdatedFeeder1.xml")

    # Returns the Extensión ArcGIS Schematics license
    arcpy.CheckInExtension("Schematics")

    print "Script completed successfully"

except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occurred on line %i" % tb.tb_lineno
    print str(e)
UpdateDiagram and Network Dataset builder example 4 (stand-alone Python script)

Updates schematic diagrams based on the Network Dataset builder.

How to use this Python script example:

  1. Start ArcMap.
  2. Open the ParisTours.mxd file stored in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Network_Dataset.
  3. Click Geoprocessing > Geoprocessing Options.
  4. Uncheck Enable on the Background Processing section, and click OK.
  5. Copy and paste the following script in the Python window.

# Name: UpdateDiagramNDS.py
# Description: Update sample schematic diagrams based on the Network Dataset builder
# Requirement: Extensión ArcGIS Schematics,Extensión ArcGIS Network Analyst 

# import system modules
import arcpy
msgNoLicenseSchematicsAvailable = "Extensión ArcGIS Schematics license required"
msgNoLicenseNetworkAnalystAvailable = "Extensión ArcGIS Network Analyst license required"


try:
    # Checks out the Extensión ArcGIS Schematics licence
    if arcpy.CheckExtension("Schematics") == "Available":
       arcpy.CheckOutExtension("Schematics")
    else:
       raise Exception(msgNoLicenseSchematicsAvailable)

    # Checks out the Extensión ArcGIS Network Analyst licence
    if arcpy.CheckExtension("Network") == "Available":
       arcpy.CheckOutExtension("Network")
    else:
       raise Exception(msgNoLicenseNetworkAnalystAvailable)

    # Sets environment settings
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = "C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Network_Dataset\NetworkAnalyst_Schematics.gdb"

    # UpdateDiagram from a solved route network analysis layer
    # 1) Solves the route network analysis layer, 
    arcpy.Solve_na("Routes\Tour2")
    # 2) Creates diagrams from this solved route network analysis layer
    # a - DiagramTour_A diagram, created with merged nodes to represent network junctions which are crossed several times along the resultant route (MERGE_NODES option)
    arcpy.CreateDiagram_schematics("NA_SchematicDataset", "DiagramTour2_A", "NADiagrams", "Routes\Tour2", "MERGE_NODES")
    # b - DiagramTour_B diagram, without merged nodes (NO_MERGE_NODES option)
    arcpy.CreateDiagram_schematics("NA_SchematicDataset", "DiagramTour2_B", "NADiagrams", "Routes\Tour2", "NO_MERGE_NODES")
    # 3) Updates those diagrams from the same solved route network analysis layer by changing the merge nodes option
    arcpy.UpdateDiagram_schematics("NA_SchematicDataset\DiagramTour2_A", "Routes\Tour2", "NO_MERGE_NODES;KEEP_MANUAL_MODIF")
    arcpy.UpdateDiagram_schematics("NA_SchematicDataset\DiagramTour2_B", "Routes\Tour2", "MERGE_NODES;KEEP_MANUAL_MODIF")

    # Returns the licences
    arcpy.CheckInExtension("Schematics")
    arcpy.CheckInExtension("Network")
    
    print "Script completed successfully"

except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occurred on line %i" % tb.tb_lineno
    print str(e)

Entornos

Esta herramienta no utiliza ningún entorno de geoprocesamiento.

Temas relacionados

Información sobre licencias

ArcGIS for Desktop Basic: Requiere Schematics
ArcGIS for Desktop Standard: Requiere Schematics
ArcGIS for Desktop Advanced: Requiere Schematics
9/11/2013