This document is archived and information here might be outdated.  Recommended version.


Sample: Convert part to feature command (ArcObjects .NET 10.4 SDK)

Convert part to feature command


PurposeThis sample creates an Edit Sketch context menu that converts a selected part to its own feature. For example, if a feature has 10 parts, a particular part can be removed from the original feature and turned into its own feature.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. 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.

  1. Start Visual Studio, open the solution, and build the project.
  2. Register the output dll.
  3. Start ArcMap, load at least one line or polygon feature class (preferably with multipart features), and start an edit session.
  4. If there are no multipart features, create one by digitizing a feature. On the Sketch context menu, select finish part, then digitize at least one more part. When you're finished creating parts, select Finish sketch or double-click to finish the sketch.
  5. Double-click at least one part of the multipart feature to enable the edit sketch.
  6. Right-click the edit sketch (if it's a polygon, click the boundary) of the part you want to convert to a single part and select the Convert Part to Feature command. The part is removed from the original feature, and a new feature is created in the same feature class.
ConvertPart.vb Class file demonstrating how to create the Edit Sketch context menu item.
Download the VB.NET files
ConvertPart.cs Class file demonstrating how to create the Edit Sketch context menu item.
Download the C# files

Download the files for all languages




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced