This sample shows how to customize the BeforeRemoveFeature predefined schematic event used to manage the removal of schematic features contained in schematic diagrams. By default, when the Remove Schematic Features command is clicked, schematic features are graphically removed without being removed from the database.
In this sample, the BeforeRemoveFeature predefined event is customized so the related record in the database is definitively removed.
Language: C#, VB
Subject: Schematics
Organization: Esri, http://www.esri.com
Date: 10/17/2019
ArcObjects SDK: 10.8
Visual Studio: 2017, 2019
.NET Target Framework: 4.5
- ArcObjects .NET API Reference online
- Sample Data Download
- What's new
- Download the ArcObjects SDK for .Net from MyEsri.com
- Start Visual Studio, open the solution file, and build the project.
- Navigate to \Samples\data\Schematics, and copy the SampleRemoval.gdb geodatabase in a folder for which you have full rights.
- Start ArcMap and open a new empty map.
- Click Customize and click Extension.
- Confirm that neither the Schematic Features Removal Events (C#) nor the Schematic Feature Removal Events (VBNet) extension is checked and close the Extensions dialog box.
- Open the Substation 08 schematic diagram contained in the SampleRemoval_Schematic schematic dataset in the SampleRemoval.gdb geodatabase you copied at step#2.
- Start an edit session on this schematic diagram.
- Select a set of schematic features in this diagram.
- Click Remove Schematic Features. The selected schematic features are graphically removed, but they are kept in the schematic feature classes.
- Close the edit session on the Substation 08 schematic diagram, and click Yes on the prompt message for saving.
- Click Update Diagram. The Update Diagram dialog box opens.
- Check the Synchronize against original selection/trace/query option and uncheck the Persist manually removed, reduced, or reconnected features option.
- Click OK. The diagram is updated and the schematic features removed in step 8 are restored and reappear in the diagram after updating.
- Click Customize and click Extension.
- Check the Schematic Features Removal Events (C#) or Schematic Feature Removal Events (VBNet) extension option and close the Extensions dialog box.
- Start an edit session on the Substation 08 schematic diagram.
- Select a set of schematic features in this diagram.
- Click Remove Schematic Features. The selected schematic features are graphically removed, but the associated records on the Inside_Nodes or Inside_Links tables from which they were queried (upon diagram generation) are also definitively removed. Updating the diagram will never restore the removed schematic features in the diagram regardless of the Persist manually removed, reduced, or reconnected features option that is used. They are no longer queried from the Inside_Nodes or Inside_Links tables because the related records have been removed.
BeforeRemoveFeature Schematic event
Development licensing | Deployment licensing |
---|---|
ArcGIS Desktop Basic: Schematics | ArcGIS Desktop Basic: Schematics |
ArcGIS Desktop Standard: Schematics | ArcGIS Desktop Standard: Schematics |
ArcGIS Desktop Advanced: Schematics | ArcGIS Desktop Advanced: Schematics |