ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Convert Diagram To Features

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Converts a schematic diagram to standard feature classes or shapefiles.

Schematic diagrams are all stored in hidden feature classes that are specific to Schematics and need the rest of the schematic configuration tables and information to be useful. This tool allows you to share diagrams with other people without having to provide the entire schematic dataset, which includes all the diagrams and the configuration. If you plan to convert multiple diagrams, you can choose whether they will all be placed into the same set of standard feature classes or shapefiles or if each diagram will get its own set of feature classes or shapefiles.

Note:

See the Code Sample section for a script tool sample that allows you to convert all diagrams contained in a schematic dataset or in a schematic folder.

Usage

  • To convert a schematic diagram layer to standard feature classes, browse to and select a geodatabase/feature dataset for the specified output location parameter. To convert a schematic diagram layer to shapefiles, browse to and select a folder.

  • To convert several diagrams into the same standard feature classes/shapefiles, check the Reuse Existing Structure option. To convert several diagrams into different standard feature classes/shapefiles, uncheck the Reuse Existing Structure option.

  • Check the Export All Related Feature Attributes option if you want to have all the real feature class attributes to be appended to the schematic records during the convert process.

  • The Export All Related Attribute Features option only works for schematic feature classes for which the Associated Feature Class/Table field value is known. If no associated feature class/table is specified for a schematic feature class, its related attribute features cannot be exported.

  • Select POLYGON in Container Geometry if you want all containers in the input schematic diagram to be converted as a polygon feature. If you want such containers to be converted as polyline (or point) features, select POLYLINE (or POINT).

    Caution:

    When working with the Reuse Existing Structure option while POLYGON (POLYLINE or POINT) has been chosen for the first diagram conversion, there is no way to change the conversion to POLYLINE or POINT (POLYGON) for the next conversions. If you want to change it, you must remove the structure and convert your diagrams again.

  • When the specified input schematic diagram layer has already been converted in the specified output location, it will be deleted before being re-created.

Syntax

ConvertDiagram_schematics (in_diagram, out_location, {reuse_fc}, {export_related_attributes}, {container_geometry}, {config_keyword})
ParameterExplanationData Type
in_diagram

The schematic diagram layer to be converted.

Schematic Layer
out_location

Workspace or feature dataset in which the schematic diagram will be converted. This container must already exist.

Workspace;Feature Dataset
reuse_fc
[reuse_fc,...]
(Optional)

Indicates whether the input schematic diagram layer will be converted in the same standard feature classes/shapefiles as the other diagrams based on the same diagram template.

  • REUSE_FC —Must be used to convert the specified diagram into the same standard feature classes/shapefiles as the other diagrams—based on the same diagram template—have already been or will be converted. In this case, depending on the chosen output location, the specified diagram is converted:
    • Into a feature dataset whose name corresponds to the diagram template name and each feature class name corresponding to the schematic feature class names.
    • Into a folder whose name corresponds to the diagram template name and each shapefile name corresponding to the schematic feature class names.
    This is the default.
  • NO_REUSE_FC —Converts the input diagram into a new feature dataset/folder whose name is the concatenation of the input diagram's diagram template name and the diagram name—each feature class/shapefile name being the concatenation of the schematic feature class name and diagram name.
Boolean
export_related_attributes
(Optional)

Indicates whether all the attributes stored in the real feature classes/object tables associated with the schematic feature classes will also be converted.

  • NO_RELATED_ATTRIBUTES —Each schematic feature contained in the input diagram is converted with only the attributes contained in its schematic feature class. This is the default.
  • EXPORT_RELATED_ATTRIBUTES —Each schematic feature contained in the input diagram is converted with the attributes contained in its schematic feature class and all the attributes related to its associated real feature.
Note:

If no associated feature class/table is specified for a schematic feature class, no feature attributes can be converted.

Note:

When using REUSE_FC and EXPORT_RELATED_ATTRIBUTES, the structure must already exist with the associated feature fields, so the related attributes are converted.

Boolean
container_geometry
[container_geometry,...]
(Optional)

Indicates the geometry type of the features that will be created for the converted schematic containers contained in the input diagram.

  • POLYGON —Each container in the input diagram is converted as a polygon feature. This is the default.
  • POLYLINE —Each container in the input diagram is converted as a polyline feature.
  • POINT —Each container in the input diagram is converted as a point feature.
Note:

When using the Reuse Existing Structure option and the structure already exists with POLYGON (POLYLINE or POINT) feature classes created for container schematic features, there is no way to change the feature class type to POLYLINE or POINT (POLYGON) for the next conversions.

String
config_keyword
(Optional)

The configuration keyword that determines the storage parameters of the table in a relational database management system (RDBMS). This is for enterprise, workgroup, or desktop geodatabase only.

String

Code Sample

ConvertDiagram example (script tool)

The following script demonstrates how to use the ConvertDiagram function in a script tool. This script tool loops on all diagrams contained in an input schematic container—that is, a schematic dataset or schematic folder—and converts them to standard features or shapefiles in an output location.How to create and configure this script tool:

  1. Copy the following script in any text editor and save the text file with the .py extension.
  2. Start ArcCatalog and open the ArcToolbox window.
  3. Add a new script:
    • Type a name for it (ConvertDiagramsTool, for example).
    • For the Script File parameter, specify the .py file you have just created.
    • Then specify the five following parameters:
      1. Display Name: Input Schematic Container, Data Type: Schematic Dataset or Schematic Folder; Type Property=Required, Direction Property=Input
      2. Display Name: Output Location, Data Type: Workspace or Feature Dataset; Type Property=Required, Direction Property=Input
      3. Display Name: Recursive, Data Type: Boolean; Type Property=Required, Direction Property=Input, Default Value=True
      4. Display Name: Diagram Class Filter, Data Type: String; Type Property=Optional, Direction Property=Input
      5. Display Name: Derived Output Location, Data Type: Workspace or Feature Dataset; Type Property=Derived, Direction Property=Output, Obtained from=Output_Location
Required input parameters: An input schematic container (dataset or folder) + an output location (GDB, feature dataset, or folder for shapefiles)Optional arguments: A recursive flag + a diagram class filter Output derived location: A workspace or feature dataset

# Name: ConvertDiagrams.py
# Description: Convert schematic diagrams
# Requirement: ArcGIS Schematics extension

# import arcpy, sys, math
import arcpy, sys, math
msgInputsErr = "Invalid arguments."
msgParseErr = "Cannot parse input arguments."
msgConvertErr = "Error during conversion."

msgNoLicenseAvailable = "ArcGIS Schematics extension license required"

# Recursively searches for schematic diagrams in the folders
def RecursiveSearch(inCont, bRecursive):
    try:
        childs = inCont.Children
        dataset = None
        for dataset in childs:
            if dataset.DataType == "SchematicFolder" and bRecursive:
                RecursiveSearch(dataset, bRecursive)
            elif dataset.DataType == "SchematicDiagram":
                if diagramClassFilter == "" or diagramClassFilter == dataset.DiagramClassname:
                    pathList.append(dataset.CatalogPath)
    except:
        raise
    
try:
# Checks out the ArcGIS Schematics extension license    
    if arcpy.CheckExtension("Schematics") == "Available":
        arcpy.CheckOutExtension("Schematics")
    else:
        raise Exception(msgNoLicenseAvailable)
except Exception as exc:
    print exc
    raise

arcpy.env.overwriteOutput = True


# Decodes parameters
try:
    inputContainer = arcpy.GetParameterAsText(0)
    outputLocation = arcpy.GetParameterAsText(1)
    recursive = arcpy.GetParameterAsText(2)
    if recursive == "false":
        recursive = None
    diagramClassFilter = arcpy.GetParameterAsText(3)
    
    if inputContainer == "":
        raise Exception()
    
except:
    print msgParseErr
    arcpy.AddError(msgParseErr)
    raise

# Main code
try:
    pathList = []   # List for diagram names to convert
    arcpy.SetProgressorLabel("Searching diagrams to convert...")
    RecursiveSearch(arcpy.Describe(inputContainer), recursive)

    arcpy.SetProgressor("step", "Converting...", 0, len(pathList), 1)

    for path in pathList:
        # Execute convert
        mes = "Converting Schematic Diagram : " + path
        # Set the progressor label
        arcpy.SetProgressorLabel(mes)
        arcpy.AddMessage(mes)
        arcpy.ConvertDiagram_schematics(path, outputLocation, "REUSE_FC", "NO_RELATED_ATTRIBUTES", "#")
        arcpy.SetProgressorPosition()

    # Returns the ArcGIS Schematics extension licence
    arcpy.CheckInExtension("Schematics")

except:
    arcpy.AddError(msgConvertErr)
    raise

Environments

  • Output CONFIG Keyword

Licensing Information

  • ArcGIS for Desktop Basic: Requires Schematics
  • ArcGIS for Desktop Standard: Requires Schematics
  • ArcGIS for Desktop Advanced: Requires Schematics

Related Topics

  • An overview of the Schematics toolbox
  • Update Diagram
  • Update Diagrams
  • Create Schematic Folder
  • Create Diagram
  • How Convert Diagram To Features (Schematics) works
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal