Delete Repeat Attribute

Plugin Introduction:

This sample is used to delete repeated values of a certain field.

Control/Object/Interface:

Control/Object/Interface Properties Methods
Plugin   Initialize(), ExitInstance()
CtrlAction FormClass Run()
Application ActiveApplication, Output, MainForm, ActiveForm  
IFormMain FormManager  
IFormMap MapControl  
ITextBox Text  
MapControl Map  
Map Layers  
DatasetVector   Query()
Recordset RecordCount, MoveFirst(), GetFieldValue(), MoveNext(), Close(), Dispose()

Basic Steps:

  1. Open DeleteRepeatedAttribute.sln in the SuperMap iDesktop 8C\SampleCode\DeleteRepeatedAttribute folder with Microsoft Visual Studio 2008 and compile it.
  2. When succeeded, you can find two files generated: SuperMap.Desktop.DeleteRepeatedAttribute.dll located in the SuperMap iDesktop 8C\Bin\Plugins\deleteRepeatedAttribute folder and SuperMap.Desktop.DeleteRepeatedAttribute.config located in the SuperMap iDesktop 8C\WorkEnvironment\Default folder.
  3. Copy the SampleIcons folder from the SuperMap iDesktop 8C\SampleCode folder to SuperMap iDesktop 8C\SampleCode\Resources.
  4. Start SuperMap iDesktop 8C.
  5. Open TabularChecking.sdb provided in the SuperMap iDesktop 8C\SampleData\SampleCodeUsed folder and open the attribute table of the City dataset. You will see the Check Attributes tab with the Delete Repeat group.
  6. In the Delete Repeat group, input Name, the field you want to check the repeated values.
  7. Click Execute to delete the repeated values in the Name field.
  8. View the results.

Data:

SuperMap iDesktop 8C\SampleData\SampleCodeUsed\TabularChecking.udb.

Note:

When you successfully compile DeleteRepeatedAttribute.sln, SuperMap.Desktop.DeleteRepeatedAttribute.dll and SuperMap.Desktop.DeleteRepeatedAttribute.config will be generated and copied to SuperMap iDesktop 8C\Bin\Plugins\DeleteRepeatedAttribute and SuperMap iDesktop 8C\WorkEnvironment\Default respectively. Each time you start SuperMap iDesktop 8C, the DeleteRepeatedAttribute plugin will be loaded.

If you want to remove the DeleteRepeatedAttribute plugin from SuperMap iDesktop 8C, you only need to delete SuperMap.Desktop.DeleteRepeatedAttribute.config in the SuperMap iDesktop 8C\WorkEnvironment\Default folder.