Exercise 2: Configuring schematic rules
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 schematics has a Node Reduction By Priority rule that will allow 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 may 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. Please 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:
- You will configure a node reduction rule to remove some things from a diagram.
- You will configure a relationship rule to add some things to a diagram.
- You will modify the relationship rule so that you get containers on our diagram.
Exercise 1 of the Schematics Advanced Configurations Tutorial is required for this exercise. You will be building on what was already configured in Exercise 1.
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 showing up in the diagrams. Net junctions are just a part of geometric networks, but not a part of the real-world equipment. So you want to get rid of them where it makes sense.
- Open ArcCatalog.
- Browse to and select 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 pop-up menu.
This starts the Schematic Dataset Editor application.
- 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 node schematic feature class to reduce drop-down list.
- Choose the Connection constraint option.
-
Uncheck the check boxes next to both of the following:
- Reduce nodes with 1 connections
- Reduce nodes with >2 connections
You could also choose No connection constraint (remove everything) to also remove the 1 connection and more than 2 connection items, but there are consequences that need to be analyzed first. Link features in schematics must have 2 connected nodes. If you remove nodes with 1 connection (they are at the end of a link), then that link must also be removed. If you remove nodes that have more than 2 connections, it can result in incorrect connections afterwards because there could be more than one way to logically reconnect things. See the help documentation for more information and other parameters available for this rule.
- 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 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.
- 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 drop-down on the Schematic toolbar and choose 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 shot 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 for saving.
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 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 to close the dialog box, then 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 the OK button to close this dialog box.
A new pug_PUG_electric schematic feature class displays in the Schematic Dataset Editor tree.
- Click the Save button 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 you want it to automatically add the electric plants. 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.
This causes the system to add the electric features and draw 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 the Save button on the Schematic Dataset Editor toolbar.
Testing the relationship rule
-
Open 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. Notice also that there are no electric plants currently on this diagram.
- Click the Schematic drop-down on the Schematic toolbar and choose the Update Diagram menu item .
-
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 save dialog boxes.
Modifying the dataset and relationship rule so it shows containers instead of lines
Here, 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 the Save button on the Schematic Dataset Editor toolbar.
Now you have to re-import the layer.
-
Right-click the BrazilTemplate entry in the Schematic Dataset Editor tree 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 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 the OK button 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.
-
Use the Properties tab on the right side of the Editor window to change the Geometry to Polygon.
- Click the Save button on the Schematic Dataset Editor toolbar.
- Select the BrazilTemplate entry in the Schematic Dataset Editor tree.
- Select 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 relationship.
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 the Save button on the Schematic Dataset Editor toolbar.
- Close the Schematic Dataset Editor.
Testing the relationship rule changes
-
Open ArcMap and load the 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 menu item .
-
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 save dialog boxes.
- Close ArcCatalog.