Aside from the basic configuration that was done in the Schematics Basic Configurations Tutorial, the next thing that is typically done is to set the default labeling and symbology. This configuration is done at the diagram template level. Then, anytime a user generates a diagram using that template, they will get the preconfigured default symbology and labeling.
In this exercise, you will learn how to set this default labeling and symbology.
Creating and configuring the database and schematic dataset
- Open ArcCatalog.
- Browse to and select the root schematics tutorial directory (C:\ArcGIS\ArcTutor\Schematics).
- Right-click this entry in the Catalog tree and choose New > Personal Geodatabase from the pop-up menu.
- Rename this database AdvancedSchematicDB.
- Right-click the AdvancedSchematicDB database and choose New > Schematic Dataset from the pop-up menu.
- Rename this dataset AdvancedSchematic.
- Right-click the AdvancedSchematic schematic dataset and choose Edit from the pop-up menu.
This will start the Schematic Dataset Editor application.
- Right-click the AdvancedSchematic entry in the Schematic Dataset Editor tree and choose New Schematic Diagram Template from the pop-up menu.
- Using the Properties tab on the right side of the editor window, type BrazilTemplate for the Name field.
- Click OK on the Properties tab.
- Right-click the BrazilTemplate entry and choose Import From Feature Layers from the pop-up menu.
This opens the Import From Feature Layers dialog box.
- Click the ellipse button at the end of the Map or Layer File input area.
This opens the Select a map or layer file to import dialog box.
- Use this dialog box to navigate to and select the Brazil.mxd file that is found in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Mixed_Data.
- Click the Add button, which will close the dialog box and update the Import From Feature Layers dialog box.
- Click OK on this dialog box.
- Click Save on the Schematic Dataset Editor toolbar.
At the end of this step, you have a configured Schematic Dataset. There is actually already default symbology that has been created because you imported from an MXD file. Since that MXD file already had symbology, Schematic tries to reuse it. You will go modify that a bit and add some labeling and see how to reset the default.
Importing a default symbology for schematic diagrams
- Open the Brazil.mxd file using ArcMap.
This file is located in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Mixed_Data.
- Use the Select Features tool to select everything in the current view.
- Click the Generate New Schematic Diagram button on the Schematic toolbar.
This opens the New Schematic Diagram dialog box.
- Click the browse button next to the Schematic Dataset or Folder drop-down list.
This opens the Select schematic dataset or schematic folder dialog box.
- Use this dialog box to browse to and select the AdvancedSchematic schematic dataset you created in step 6 of the Creating and configuring the database and schematic dataset section above.
- Click the Add button.
Since your configuration only has one diagram template (BrazilTemplate), it is automatically selected in the Schematic Diagram Template section.
- Type TestDiagram in the Schematic Diagram Name text box.
- Click OK.
You will get a schematic diagram based on the selected features and using the same symbology that was configured for the GIS Features in the map.
Joining and relating tables to draw or label schematic features
Now you will make some changes. You will change the drawing order for the pipelines net junctions. You will also change the symbol color for gas plants. Finally, you will add a join to the gas plants layer so you can label based on the GIS features attributes.
- Double-click the pug_PUG_gas_plants entry in the table of contents that is found under the TestDiagram diagram layer.
This opens the Layer Properties dialog box.
- Select the Symbology tab.
- Click the red gas plant symbol button found in the Symbol section to open the Symbol Selector dialog box.
- Change the color to blue.
- Click OK to close the Symbol Selector dialog box.
- Select the Joins & Relates tab on the Layers Properties dialog box.
When working with data coming from a network dataset or a geometric network, joining data is straightforward for Schematics. Schematic features keep track of the real GIS feature's object. So you just need to join this field (UOID) in the Schematic Feature Class to the real GIS feature's OBJECTID field in the GIS Feature Class.
- Click the Add button on the Joins section at the left.
This opens the Join Data dialog box:
- Choose UOID from the Choose the field in this layer that the join will be based on drop-down list.
- Click the browse button next to the Choose the table to join this layer, or load the table from disk drop-down list.
The Add dialog box opens.
- Navigate to and select the pug_PUG_gas_plants feature class that is in the pipelines feature dataset in the Brazil.gdb database, which is found in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Mixed_Data.
- Click the Add button.
- Choose OBJECTID from the Choose the field in the table to base the join on drop-down list.
You have now created a join from the schematic feature class to the real GIS feature class.
- Click OK.
The Join & Relates tab displays as in the following screen shot:
- Select the Labels tab.
- Check the check box for Label features in this layer.
- Use the Label Field drop-down list to select NAME.
Note that this came from the real feature class because of the join. Without the join, this field would not have been displayed in the list.
- Click OK.
Now you should have a diagram where the following are true:
- The pipelines_Net_Junctions are drawing on top of the joined_pipe layer.
- The pug_PUG_gas_plants symbol is blue.
- The pug_PUG_gas_plants features are being labeled because of the join to the real feature class.
Creating a layer file to be used as a diagram template default
Now, you will learn how to set this labeling and symbology as the default for all the schematic diagrams based on the same schematic diagram template.
- Right-click the TestDiagram diagram layer in the table of contents and choose Save As Layer File from the pop-up menu to open the Save Layer dialog box.
- Browse to and select the Schematics folder found in C:\ArcGIS\ArcTutor\Schematics.
- Change the name to BrazilTemplate.lyr.
- Click the Save button.
At this point, you have a layer file that has all the definitions for the changes you made. You could start a new instance of the Brazil.mxd file, generate a diagram, and import this layer file, and you would get the same result. However, to make things easier for the ArcMap end user, you want this to be the default result.
- Close ArcMap and choose No to the save prompt.
Setting and testing the new default labeling and symbology for the BrazilTemplate diagram template
- Switch back to the Schematic Dataset Editor application.
- Right-click the BrazilTemplate entry in the editor tree view and choose Import Default Symbology from the pop-up menu to open the Select Schematic Layer dialog box.
- Browse to and select the BrazilTemplate.lyr file created in step 23 above.
- Click the Open button.
- Click Save on the Schematic Dataset Editor toolbar.
- Close the Schematic Dataset Editor.
- Open the Brazil.mxd file using ArcMap.
This file is located in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Mixed_Data.
- Use the Select Features tool to select everything in the current view.
- Click the Generate New Schematic Diagram button on the Schematic toolbar.
This opens the New Schematic Diagram dialog box.
- Click the browse button next to the Schematic Dataset or Folder drop-down list.
This opens the Select schematic dataset or schematic folder dialog box.
- Use this dialog box to browse to and select the AdvancedSchematic schematic dataset created in step 6 of the Creating and configuring the database and schematic dataset section above.
- Click the Add button.
Since your configuration only has one diagram template (BrazilTemplate), it is automatically selected in the Schematic Diagram Template section.
- Type TestDefaults in the Schematic Diagram Name text box.
- Click OK.
You will get a schematic diagram based on the selected features and using the same symbology and labeling that was saved in the layer file and imported as the new defaults for your diagram template.
- Close ArcMap and click No to any save dialog boxes.
- Close ArcCatalog.