Schematic rules are very useful for automatically adding or removing things from diagrams. For example, in a utility network, there are often types of equipment that users do not want to see in their schematic diagrams. So ArcGIS Schematics has a node reduction by priority rule that allows those items to be reduced, and the links that connect them are turned into superspans that connect to the next items. Another example might be a social network where things are related to each other via relationship classes in the geodatabase. Here, you might want to allow the user to just select one thing on the map and have Schematics use the relationship class information to automatically add the related items to the diagram. For this, you would use the relationship rule in Schematics. There are several other rules, all built for certain purposes. Consult the help files for more information on each of the rules available.
In this exercise, you will work with two different rules and do the following tasks:
- Configure a node reduction rule to remove some things from a diagram.
- Configure a relationship rule to add some things to a diagram.
- Modify the relationship rule so that you get containers on your diagram.
Creating and configuring a node reduction rule
Start by creating and configuring a node reduction rule to remove the pipelines_Net_Junctions nodes that are in the diagrams. Net junctions are part of geometric networks, but not of the real-world equipment. So you want to get rid of them where it makes sense.
- Start ArcCatalog.
- Browse to and choose the root AdvancedSchematicDB geodatabase that should be found in C:\ArcGIS\ArcTutor\Schematics.
- Right-click the AdvancedSchematic schematic dataset that is within this geodatabase and choose Edit from the context menu.
The Schematic Dataset Editor dialog box appears.
- Click the BrazilTemplate entry in the Schematic Dataset Editor tree if it is not already selected.
- Click the Rules tab on the right side of the editor window.
- Click the Add Rule button .
Node Reduction By Priority happens to be the default rule in the Type drop-down list, and this is the rule that you want to use. You can use the drop-down list to see the other available rules.
- Click the Rule Properties button to open the Node reduction by priority rule attributes tab, where you will finish the configuration.
- Type Remove Junctions in the Description text box.
- Select pipelines_Net_Junctions in the Select the schematic class to reduce drop-down list.
- Choose the Connection constraint option.
Reduce nodes with 0 connections and Reduce nodes with 2 connections are checked by default.
- Click OK.
- Click the Save button on the Schematic Dataset Editor toolbar.
Testing the node reduction by priority rule
- Open the Brazil.mxd file using ArcMap.
This file is located in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Mixed_Data.
- Click the Open Schematic Diagrams button on the Schematic toolbar to open the Select Schematic Diagrams To Open dialog box.
- Browse to and choose the diagram named TestDiagram from the AdvancedSchematic schematic dataset, which is located in the AdvancedSchematicDB geodatabase in C:\ArcGIS\ArcTutor\Schematics.
- Click the Add button to open this diagram in the map.
Notice that at this point nothing has changed. Rules are only applied during diagram generation or update.
- Right-click the pipelines_Net_Junctions layer that belongs to the TestDiagram schematic layer and choose Selection > Select All.
- Click the List By Selection button on the toolbar for the Table Of Contents window.
Note the number of pipelines_Net_Junctions features currently in the diagram.
- Click the Clear Selected Features button on the Tools toolbar.
- Click the List By Drawing Order button on the toolbar for the Table Of Contents window.
- Click the Schematic arrow on the Schematic toolbar and click Update Diagram to open the Update Diagram dialog box.
- Click OK.
- Right-click the pipelines_Net_Junctions layer that belongs to the TestDiagram schematic layer and choose Selection > Select All.
- Click the List By Selection button on the toolbar for the Table Of Contents window.
Note the number of pipelines_Net_Junctions features currently in the diagram. This number should be significantly reduced. Your screen capture may not exactly match this one, depending on what your initial selection was when you generated the TestDiagram schematic diagram.
- Close ArcMap and choose No if prompted to save.
Creating and configuring a relationship rule
There is already a relationship class in the Brazil data you have been using. The class exists between the pug_PUG_gas_plants feature class and the pug_PUG_electric feature class. Since pug_PUG_electric is not part of the geometric network, it was not imported when you ran the import from feature layers earlier. Start by importing that layer.
- Switch to the Schematic Dataset Editor application.
- Right-click the BrazilTemplate entry in the Schematic Dataset Editor tree and choose Import From Feature Layers from the context menu.
This opens the Import From Feature Layers dialog box.
- Click the ellipsis (...) 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 to close the dialog box and update the Import From Feature Layers dialog box.
- Click the Clear All button to remove all the selected items, since you already imported those in exercise 1.
- Check the check box next to electric.
- Click OK to close this dialog box.
A new pug_PUG_electric schematic feature class is displayed in the Schematic Dataset Editor tree.
- Click Save on the Schematic Dataset Editor toolbar.
- Click the BrazilTemplate entry in the Schematic Dataset Editor tree and click the Rules tab.
- Click the Add Rule button .
- Use the Type drop-down list to choose Relationship.
- Click the Rule Properties button to open the Relationship rule attributes tab, where you will finish the configuration.
- Type Gas to Electric in the Description text box.
- Use the Select a source drop-down list to choose pug_PUG_gas_plants.
When setting these options, you have to think in terms of what the map user will be doing. In this case, the map user will be selecting a gas plant, and the rule will automatically add the electric plants related to it. So pug_PUG_gas_plants will be the source here. The system sees that there is a relationship class in the geodatabase between pug_PUG_gas_plants and pug_PUG_electric, so it automatically fills in some information for you.
- In the Relations section, check the check box for Create links.
The system adds the electric features and draws links from the gas plants to the electric so they are logically connected, even though they are not physically connected by the geometric network.
- Click OK.
- Click Save on the Schematic Dataset Editor toolbar.
Testing the relationship rule
- Start ArcMap and load the Brazil.mxd file.
This file is located in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Mixed_Data.
- Click the Open Schematic Diagrams button on the Schematic toolbar to open the Select Schematic Diagrams To Open dialog box.
- Browse to and choose the diagram named TestDiagram from the AdvancedSchematic schematic dataset, which is located in the AdvancedSchematicDB geodatabase in C:\ArcGIS\ArcTutor\Schematics.
- Click the Add button to open this diagram in the map.
Notice that at this point nothing has changed. Rules are only applied during diagram generation or update. Notice also that there are no electric plants currently on this diagram.
- Click the Schematic arrow on the Schematic toolbar and choose the Update Diagram command.
- Click OK on the Update Diagram dialog box.
You should now have two new lines connecting from the gas plants that were already on the diagram to the new electric plant that has been added because of the relationship rule.
- Close ArcMap and choose No on any dialog boxes prompting you to save.
Modifying the dataset and relationship rule so it shows containers instead of lines
You will make a few small changes so you can see this relationship via the use of containers. Since the electric station feeds power to both gas plants, draw the electric station as a container that contains both its related gas plants. When you imported the pug_PUG_electric feature layer, it came in as a node with point geometry. This won't work for containers. A container needs to be a polygon or a polyline. So you have to also fix this.
- Switch to the Schematic Dataset Editor application.
- Expand the BrazilTemplate entry in the Schematic Dataset Editor tree so you can see all the schematic feature classes associated with this diagram template.
- Right-click pug_PUG_electric and choose Delete from the menu.
- Click Yes on the delete message.
- Click Save on the Schematic Dataset Editor toolbar.
Now you have to reimport the layer.
- Right-click the BrazilTemplate entry in the Schematic Dataset Editor tree and choose Import From Feature Layers from the context menu.
This opens the Import From Feature Layers dialog box.
- Click the ellipsis (...) 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 the Clear All button to remove all the selected items, since you already imported those in exercise 1.
- Check the check box next to electric.
- Click OK to close this dialog box.
This time, you will be careful not to save, as you have to modify the schematic feature class so that it has a geometry of a polygon instead of a point.
- Select the pug_PUG_electric entry in the Schematic Dataset Editor tree.
- On the Properties tab on the right side of the editor window, change Geometry to Polygon.
- Click Save on the Schematic Dataset Editor toolbar.
- Select the BrazilTemplate entry in the Schematic Dataset Editor tree.
- Click the Rules tab.
- Select the second line, the relationship rule, so that it is the active row.
- Click the Rule Properties button on the Rules tab.
- Check the check box for Relate source and target schematic features.
- Check the check box for Reverse relation.
You want the electric plant to be the parent or container here, but it is the target in the rule, so you have to reverse the relationship. Again, this is because users will think about selecting the gas plants, not the electric plants. It could be done the other way around, though.
- Uncheck the Create links check box.
- Click OK.
- Click Save on the Schematic Dataset Editor toolbar.
- Close the Schematic Dataset Editor dialog box.
Testing the relationship rule changes
- Start ArcMap and load the Brazil.mxd file.
This file is located in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Mixed_Data.
- Click the Open Schematic Diagrams button on the Schematic toolbar to open the Select Schematic Diagrams To Open dialog box.
- Browse to and select the diagram named TestDiagram from the AdvancedSchematic schematic dataset, which is located in the AdvancedSchematicDB geodatabase in C:\ArcGIS\ArcTutor\Schematics.
- Click the Add button to open this diagram in the map.
Notice that at this point, nothing has changed. Rules are only applied during diagram generation or update. You still see the electric plant with links connected to the gas plants.
- Click the Schematic drop-down list on the Schematic toolbar and choose the Update Diagram command.
- Click OK on the Update Diagram dialog box.
You should now have a container that represents the electric plant going around both gas plants: The interesting thing with containers is that during editing, the containers add some functionality. If you move the container, its contents automatically move with it. If you move the contents, the container automatically resizes to fit its contents.
- Close ArcMap and choose No on any dialog boxes prompting you to save.
- Close ArcCatalog.