Implementing an XML builder external component


Purpose
This sample demonstrates the implementation of ISchematicXmlGenerate and ISchematicXmlUpdate to automatically create the input Extensible Markup Language (XML) data to generate and update diagrams based on the XML builder. The creation of the input XML data is based on the features in the GISForXMLSample geodatabase. This component can be used to generate and update XML builder diagrams from features contained in this geodatabase when they are currently selected on a map document.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample.

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/Schematics/GISForXMLSample.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

Building the component
  1. Start Visual Studio, open the solution file, and build the component.

Copying the sample database in a working folder
  1. Navigate to <ArcGIS DeveloperKit install location>\Samples\data\Schematics
  2. Copy both the GISForXMLSample.gdb geodatabase and the GISForXMLSample.mxd file in a folder for which you have full rights.

Configuring the schematic dataset
  1. Start ArcCatalog.
  2. Browse to the GISForXMLSample geodatabase you have just copied.
  3. Right-click the GISForXMLSample_Schematic schematic dataset contained in this geodatabase and click Edit. The Schematic Dataset Editor opens.
  4. Click the XMLDiagrams diagram template in the Dataset Editor tree.
  5. On the Properties tab on the right, click the Schematic Builder Properties button. The Schematic Builder Properties dialog box opens.
  6. Type MyExtXMLComponentCS.XMLDocImpl or MyExtXMLComponentVB.XMLDocImpl (depending on the language you're using) in the Generate and Update fields.
  7. Check the Initialize link vertices and Automatic schematic feature class creation options.
  8. Click OK.
  9. Click Save and exit the Schematic Dataset Editor.

Testing the XML builder diagram generate and update functions
  1. Start ArcMap and open the GISForXMLSample.mxd file from your working folder. This .mxd file references the ElectricDataset feature dataset stored in the copied GISForXMLSample geodatabase.
  2. Start the Schematics extension.
  3. In ArcMap, click Customize, click Toolbars, and choose the Schematic, Schematic Editor, and Schematic Network Analyst toolbars.
  4. Click the Select Features tool on the Tools toolbar and select a set of features on the active data frame.
  5. Click Generate New Schematic Diagram on the Schematic toolbar. The New Schematic Diagram dialog box opens.
  6. Ensure that the GISForXMLSample_Schematic schematic dataset is selected on the Schematic Dataset or Schematic Folder drop-down list and that the XMLDiagrams diagram template is selected on the Schematic Diagram Template drop-down list.
  7. Type a name for the diagram in the Schematic Diagram Name field, for example, XMLDiagramFromSelection1.
  8. Click OK. The XMLDiagramFromSelection1 diagram, based on the selected set of features, is generated and opens in a new data frame.
  9. Activate the Layers data frame containing the ElectricDataset features and select a new set of features.
  10. Click Schematic on the Schematic toolbar and click Update Diagram. The Update Diagram dialog box opens.
  11. Click OK. The active diagram is updated according to the features currently selected on the map.
  12. Select the Propagate Map Selection to Schematic command to confirm that the schematic features contained in the active diagram are correctly associated with the features from which they were created.

XMLDocImpl.vb Implementation of the ISchematicXMLGenerate and ISchematicXMLUpdate interfaces.
Download the VB.NET files
XMLDocImpl.cs Implementation of the ISchematicXMLGenerate and ISchematicXMLUpdate interfaces.
Download the C# files

Download the files for all languages

See Also:

ISchematicXMLGenerate interface
ISchematicXMLUpdate interface




Development licensing Deployment licensing
ArcGIS for Desktop Basic: Schematics ArcGIS for Desktop Basic: Schematics
ArcGIS for Desktop Standard: Schematics ArcGIS for Desktop Standard: Schematics
ArcGIS for Desktop Advanced: Schematics ArcGIS for Desktop Advanced: Schematics