Skip To Content
ArcGIS Developer

Generate Diagram


The generateDiagram operation is performed on a schematic diagram template resource. The result of this operation is a Schematic Diagram Information Object. It is used to generate a new diagram.


Schematics services published without the Editing operation enabled don't support the generateDiagram operation. Moreover, the generateDiagram operation is only supported on schematic diagram templates when canGenerate=True; that is, when the published map references the schematic diagram template layer.

You can provide arguments to the generateDiagram operation as query parameters defined in the parameters table below.

Request Parameters


Description: The response format. The default response format is html.

Values: html | json



Description: The diagram name.

Syntax: name=<diagramName>

Example: name=MyTestDiagram



Description: The diagram creator.

Syntax: user=<diagramCreator>

Example: user=NCA3885


Description: The ID of the folder in which the generated diagram will be stored.

This parameter is optional. If it is not specified, the generated diagram is stored at the schematic dataset root.

Syntax: folderID=<diagramFolderID>

Example: folderID=1



Description: The context for the builder which updates the diagram.

This parameter syntax depends on the diagram builder:

  • Diagrams based on the Standard builder that are generated from a set of GIS features/objects

    In that case, the operation expects the lists of the input GIS feature/object IDs per feature class/object table, and those features/objects version:


      //The lists of the input GIS feature/object IDs per feature class/object table from which the diagram must be generated
      "initialObjects": [
          "objectClassName" : "<objectClass1Name>",
          "objectIDs" : [ID11, ..., IDN] 
          "objectClassName" : "<objectClassNName>",
          "objectIDs" : [ID1, ..., IDM] 
      //The SDE database reference version for those input GIS features/objects
      "version": "<version>"


    builderContext={"initialObjects": [{"objectClassName": "PipelinesDatabase.SDE.pug_PUG_gas_plants", "objectIDs": [3]}], "version":"sde.DEFAULT"}


    The version parameter is mandatory. We recommend to specify the version when you work with GIS features/objects stored in geodatabases. For this case, when specifying no version, the version used is the one configured on the Associated Object Class section of the Properties tab that displays for the associated schematic feature class when you edit the schematic dataset within Schematic Dataset Editor.

    When generating a schematic diagram based on the Standard builder from a set of GIS features that compose a geometric network or network dataset, if the Standard builder properties are configured with the Add connected nodes option enabled, you can provide only the list of edge/line features.
  • Diagrams based on the Standard builder that are entirely built from custom queries

    In that case, the operation expects an empty list of initial objects:


    builderContext={"initialObjects": []}


    builderContext={"initialObjects": []}

  • Diagrams based on the XML builder

    In that case, the operation expects the input XML data directly as a string.

    Syntax: builderContext=<XMLData>


    	<Diagram DiagramTemplateName="SimpleXML">

Example Usage

The map used to publish the S1_Schematics Schematics service referenced the MainNetwork schematic diagram template layer. This template is based on the Standard builder and works from input GIS features organized into a geometric network.

Since this sample service was published without the Editing operation enabled, the generateDiagram operation is not supported. But, with the Editing operation enabled, you could generate a TestDiagram schematic diagram based on this template (id=2) from a set of PrimaryLine geometric network edge features; for example, {"initialObjects": [{"objectClassName": "PrimaryLine", "objectIDs": [1,2,3,4,5,6,178,179,460,555,973,1537,1809,1810,1972,17973,2292,2293,2321,2322,2323,2324,2326,2627]}]}, by executing the operation as follows:

JSON Response Syntax

  "name": "<diagramName>",
  "id": "<diagramId>",
  "templateIdentifier": "<templateIdentifier>",
  "templateObjectID": <templateObjectID>,
  "schematicLayerIdentifier": <schematicLayerIdentifier>,
  "folderObjectID": <folderObjectID>,
  "folderIdentifier": "<folderIdentifier>",
  "objectID": <objectID>,
  "createdBy": "<diagramCreator>",
  "lastModificationBy": "<diagramLastEditor>",
  "lastUpdateBy": "<diagramLastUpdator>",
  "creationDate": "<diagramCreationDate>",
  "lastModificationDate": "<diagramModificationDate>",
  "lastUpdateDate": "<diagramLastUpdateDate>",
  "lockedBy": "<diagramLastLocker>",
  "version": "<version>",
  "extent": <envelope>,
  "rootNodes": [
  "endNodes": [

JSON Response Example

  "name": "DiagramFrom_pug_PUG_gas_plants_ID3",
   "id": "0-5",
   "templateIdentifier": "0",
   "templateObjectID": 892,
   "schematicLayerIdentifier": 0,
   "folderObjectID": -2,
   "folderIdentifier": "-2",
   "objectID": 5,
   "createdBy": "NCA3885",
   "lastModificationBy": "NCA3885",
   "lastUpdateBy": "",
   "creationDate": "05/13/11 14:13:57",
   "lastModificationDate": "05/13/11 14:13:57",
   "lastUpdateDate": "",
   "lockedBy": "",
   "version": "sde.DEFAULT",
   "extent": {
     "xmin": -37.342619999999989,
     "ymin": -11.398460000000886,
     "xmax": -37.342179999999097,
     "ymax": -11.398019999999997,
     "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326