Implementing extended criteria for some predefined schematic rules


Purpose
This sample shows how to implement custom extended criteria that are intended for use with the following schematic rules:
  • Node Reduction By Priority
  • Feature Removal
  • Expand Links
  • Collapse Related Elements
This sample will help you become familiar with the ISchematicNodeReductionExtended, ISchematicCollapseRelatedElementsExtended, ISchematicFeatureRemovalExtended, and ISchematicExpandLinksByAttributeExtented interfaces, and it will help you understand how these interfaces must be implemented to use a custom criterion to achieve the following:
  • Reduce nodes during a Node Reduction By Priority rule execution
  • Remove schematic features during a Feature Removal Links rule
  • Expand schematic links during an Expand Links rule execution
  • Collapse schematic features during a Collapse Related Elements rule execution
Any criterion can be combined with the other options specified for the rule to define the final set of schematic features that will be impacted during the rule execution.
 
These extended criteria have been developed to work with data stored in the ExtendedCriteriaSamples sample geodatabase containing cable links and plant nodes.
 
The PlantOnCableDiameter and PlantWithoutEquipment extended criteria are implemented for the Node Reduction By Priority rule as follows:
  • PlantOnCableDiameter works on the set of incident cable links related to a node candidate for being reduced. If all incident cable diameters are 8, the candidate node is reduced.
  • PlantWithoutEquipment works directly on the candidate plant nodes that can be reduced. The candidate node is reduced only when it does not have any associated record in a specific database table.
The FeatureRemovalExt extended criterion is implemented for the Feature Removal rule; it can be used to remove cable schematic links that have particular identifiers.
 
The ExpandLinksExt extended criterion is implemented for the Expand Links rule; it is used to expands cable schematic links according to particular attribute values on their plant origin nodes.
 
The CollapseRelatedElts extended criterion is a template class you must customize to use an extended criterion for Collapse Related Elements rules.

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/ExtendedCriteriaSamples.gdb.
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 project.

Configuring a Node Reduction By Priority rule using the Reduce if connected cable diameters are 8 custom reduce extended criteria
  1. Start ArcCatalog, browse to the ExtendedCriteriaSamples geodatabase, right-click the ExtendedCriteriaSamples_Schematic schematic dataset, then click Edit.
  2. From the Schematic Dataset Editor tree, click the DiagramsFromSampleFeatureDataset diagram template.
  3. Click the Rules tab.
  4. If there are rule items on the Rules tab, uncheck their related Active box.
  5. Click Add Rule on the Rules tab toolbar.
  6. Select Node Reduction By Priority from the Type drop-down list .
  7. Click Rule Properties on the Rules tab toolbar. The Node Reduction By Priority rule properties page displays.
  8. Type a description for the newly created rule; for example, type Reduce plants whose connected cables diameters are 8.
  9. Select plants for the Select node element class to reduce.
  10. Keep the default reduction options, then check Use extended criteria.
  11. The two custom reduction extended criteria that were automatically registered when the solution was built are available from the drop-down list under the Use extended criteria check box. Click Reduce if connected cable diameters are 8 (VBNet) or Reduce if connected cable diameters are 8 (C#) from the drop-down list and click OK.
  12. Save and exit the Schematic Dataset Editor.
  13. Start ArcMap with an empty map.
  14. Click Open Schematic Diagrams on the Schematic toolbar and open the TestReduction_Diameter schematic diagram stored in the ExtendedCriteriaSamples.gdb\ExtendedCriteriaSamples_Schematic schematic dataset.
  15. Click Update Diagram on the Schematic toolbar. The Update Diagram dialog box opens.
  16. Keep the Synchronize against original selection/trace/query option checked and click OK. At the end of the update process, all plants' connecting links whose diameters are 8 are reduced.

Configuring a Node Reduction By Priority rule using the Reduce plants without equipments custom reduce extended criteria
  1. Start ArcCatalog, browse to the ExtendedCriteriaSamples geodatabase, right-click the ExtendedCriteriaSamples_Schematic schematic dataset, then click Edit.
  2. From the Schematic Dataset Editor tree, click the DiagramsFromSampleFeatureDataset diagram template.
  3. Click the Rules tab.
  4. If there are rule items on the Rules tab, uncheck their related Active box.
  5. Click Add Rule on the Rules tab toolbar.
  6. Select Node Reduction By Priority from the Type drop-down list .
  7. Click Rule Properties on the Rules tab toolbar. The Node Reduction By Priority rule properties page displays.
  8. Type a description for the newly created rule; for example, type Reduce plants without equipments.
  9. Select plants for the Select node element class to reduce.
  10. Keep the default reduction options, then check Use extended criteria.
  11. The two custom reduction extended criteria that were automatically registered when the solution was built are available from the drop-down list under the Use extended criteria check box. Click Reduce plant without equipments (VBNet) or Reduce plant without equipments (C#) from the drop-down list and click OK.
  12. Save and exit the Schematic Dataset Editor.
  13. Start ArcMap with an empty map.
  14. Click Open Schematic Diagrams on the Schematic toolbar and open the TestReduction_Equipments schematic diagram stored in the ExtendedCriteriaSamples.gdb\ExtendedCriteriaSamples_Schematic schematic dataset.
  15. Click Update Diagram on the Schematic toolbar. The Update Diagram dialog box opens.
  16. Keep the Synchronize against original selection/trace/query option checked and click OK. At the end of the update process, the plants without equipments are reduced.

Configuring a Feature Removal rule using the Remove cables with particular ID custom reduce extended criteria
  1. Start ArcCatalog, browse to the ExtendedCriteriaSamples geodatabase, right-click the ExtendedCriteriaSamples_Schematic schematic dataset, then click Edit.
  2. From the Schematic Dataset Editor tree, click the DiagramsFromSampleFeatureDataset diagram template.
  3. Click the Rules tab.
  4. If there are rule items on the Rules tab, uncheck their related Active box.
  5. Click Add Rule on the Rules tab toolbar.
  6. Select Feature Removal from the Type drop-down list .
  7. Click Rule Properties on the Rules tab toolbar. The Feature Removal rule properties page displays.
  8. Type a description for the newly created rule; for example, type Remove cables with particular ID.
  9. Select cables for the Select the schematic feature class to remove.
  10. Keep the default removal options, then check Use extended criteria.
  11. Click Remove cables with particular ID (VBNet) or Remove cables with particular ID (C#) from the drop-down list under this check box, and click OK.
  12. Save and exit the Schematic Dataset Editor.
  13. Start ArcMap with an empty map.
  14. Click Open Schematic Diagrams on the Schematic toolbar and open the TestRemoval_ParticularCables schematic diagram stored in the ExtendedCriteriaSamples.gdb\ExtendedCriteriaSamples_Schematic schematic dataset.
  15. Click Update Diagram on the Schematic toolbar. The Update Diagram dialog box opens.
  16. Keep the Synchronize against original selection/trace/query option checked and click OK. At the end of the update process, two cables are removed.

Configuring an Expand Links rule using the Use origin plant's MaxOutLines value custom reduce extended criteria
  1. Start ArcCatalog, browse to the ExtendedCriteriaSamples geodatabase, right-click the ExtendedCriteriaSamples_Schematic schematic dataset, then click Edit.
  2. From the Schematic Dataset Editor tree, click the DiagramsFromSampleFeatureDataset diagram template.
  3. Click the Rules tab.
  4. If there are rule items on the Rules tab, uncheck their related Active box.
  5. Click Add Rule on the Rules tab toolbar.
  6. Select Expand Links from the Type drop-down list.
  7. Click Rule Properties on the Rules tab toolbar. The Expand Links rule properties page displays.
  8. Type a description for the newly created rule; for example, type Expand cables based on its origin plant's MaxOutLines value.
  9. Select cables for the Select the link schematic feature class to expand.
  10. Check Use extended criteria on the Select value source section.
  11. Choose Use origin plant's MaxOutLines value (VBNet) or Use origin plant's MaxOutLines value (C#) from the drop-down list under this check box, and click OK.
  12. Check the Integer value option on the Value format section.
  13. Save and exit the Schematic Dataset Editor.
  14. Start ArcMap with an empty map.
  15. Click Open Schematic Diagrams on the Schematic toolbar and open the TestExpandLinks_FromOriginPlant schematic diagram stored in the ExtendedCriteriaSamples.gdb\ExtendedCriteriaSamples_Schematic schematic dataset.
  16. Click Update Diagram on the Schematic toolbar. The Update Diagram dialog box opens.
  17. Keep the Synchronize against original selection/trace/query option checked and click OK.
  18. Click Start Editing Diagram on the Schematic Editor toolbar.
  19. Choose Separate Overlapping Links in the Layout Task drop-down list.
  20. Click Apply Layout Task. Several links now connect the same plant nodes. The number of links between two plant nodes correspond to the MaxOutLines value on the initial cable's plant origin node.

PlantWithoutEquipment.vb Implements a node reduction criterion based on the nonexistence of equipment related to a plant feature candidate to the reduction.
PlantOnCableDiameter.vb Implements a node reduction criterion based on the diameter value of the cable links incident to a plant feature candidate to the reduction.
FeatureRemovalExt.vb Implements a feature removal criterion based on the name of the cable schematic links candidate to the removal.
ExpandLinks.vb Implements an expand links criterion based on attribute values on the origin node of the cable schematic links candidate to the expansion.
CollapseRelatedElts.vb Implements a basic code to develop a collapse related elements criterion.
EnumCollapsedElts.vb Used by the CollapseRelatedElts class.
Download the VB.NET files
PlantWithoutEquipment.cs Implements a node reduction criterion based on the nonexistence of equipment related to a plant feature candidate to the reduction.
PlantOnCableDiameter.cs Implements a node reduction criterion based on the diameter value of the cable links incident to a plant feature candidate to the reduction.
FeatureRemovalExt.cs Implements a feature removal criterion based on the name of the cable schematic links candidate to the removal.
ExpandLinks.cs Implements an expand links criterion based on attribute values on the origin node of the cable schematic links candidate to the expansion.
CollapseRelatedElts.cs Implements a basic code to help you to develop a collapse related elements criterion.
EnumCollapsedElts.cs Used by the CollapseRelatedElts class.
Download the C# files

Download the files for all languages

See Also:

ISchematicCollapseRelatedElementsExtended interface
ISchematicNodeReductionExtended interface
ISchematicFeatureRemovalExtended interface
ISchematicExpandLinksByAttributeExtended interface




Development licensing Deployment licensing
ArcView: Schematics ArcView: Schematics
ArcEditor: Schematics ArcEditor: Schematics
ArcInfo: Schematics ArcInfo: Schematics